Use AddNewtonsoftJson in RazorPages template (#6877)

This commit is contained in:
Pranav K 2019-01-19 21:18:26 -08:00 committed by GitHub
parent 07382c5da4
commit 371595962a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -16,7 +16,7 @@
<None Update="app.db" CopyToOutputDirectory="PreserveNewest" /> <None Update="app.db" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup> </ItemGroup>
<ItemGroup Condition="'$(OrganizationalAuth)' == 'True' OR '$(IndividualB2CAuth)' == 'True' OR '$(IndividualLocalAuth)' == 'True' "> <ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authentication.AzureAD.UI" Version="${MicrosoftAspNetCoreAuthenticationAzureADUIPackageVersion}" Condition="'$(OrganizationalAuth)' == 'True'" /> <PackageReference Include="Microsoft.AspNetCore.Authentication.AzureAD.UI" Version="${MicrosoftAspNetCoreAuthenticationAzureADUIPackageVersion}" Condition="'$(OrganizationalAuth)' == 'True'" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.AzureADB2C.UI" Version="${MicrosoftAspNetCoreAuthenticationAzureADB2CUIPackageVersion}" Condition="'$(IndividualB2CAuth)' == 'True'" /> <PackageReference Include="Microsoft.AspNetCore.Authentication.AzureADB2C.UI" Version="${MicrosoftAspNetCoreAuthenticationAzureADB2CUIPackageVersion}" Condition="'$(IndividualB2CAuth)' == 'True'" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="${MicrosoftAspNetCoreDiagnosticsEntityFrameworkCorePackageVersion}" Condition=" '$(IndividualLocalAuth)' == 'True' " /> <PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="${MicrosoftAspNetCoreDiagnosticsEntityFrameworkCorePackageVersion}" Condition=" '$(IndividualLocalAuth)' == 'True' " />

View File

@ -125,9 +125,11 @@ namespace Company.WebApplication1
.RequireAuthenticatedUser() .RequireAuthenticatedUser()
.Build(); .Build();
options.Filters.Add(new AuthorizeFilter(policy)); options.Filters.Add(new AuthorizeFilter(policy));
}); })
.AddNewtonsoftJson();
#else #else
services.AddMvc(); services.AddMvc()
.AddNewtonsoftJson();
#endif #endif
} }