Merge pull request #1800 from abpframework/maliming/Newtonsoft.Json

Use Newtonsoft.Json in AbpAspNetCoreMvc Module.
pull/1850/head
Halil İbrahim Kalkan 6 years ago committed by GitHub
commit 8a464ff296
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -26,6 +26,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="3.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="4.0.0-preview8.19405.7" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.0.0" />
</ItemGroup>
</Project>

@ -15,6 +15,7 @@ using System.Reflection;
using Volo.Abp.ApiVersioning;
using Volo.Abp.AspNetCore.Mvc.Conventions;
using Volo.Abp.AspNetCore.Mvc.DependencyInjection;
using Volo.Abp.AspNetCore.Mvc.Json;
using Volo.Abp.AspNetCore.Mvc.Localization;
using Volo.Abp.AspNetCore.VirtualFileSystem;
using Volo.Abp.DependencyInjection;
@ -76,6 +77,11 @@ namespace Volo.Abp.AspNetCore.Mvc
);
var mvcBuilder = context.Services.AddMvc()
.AddNewtonsoftJson(options =>
{
options.SerializerSettings.ContractResolver =
new AbpMvcJsonContractResolver(context.Services);
})
.AddRazorRuntimeCompilation()
.AddDataAnnotationsLocalization(options =>
{
@ -110,11 +116,6 @@ namespace Volo.Abp.AspNetCore.Mvc
{
mvcOptions.AddAbp(context.Services);
});
//Configure<MvcJsonOptions>(jsonOptions => @3.0.0!
//{
// jsonOptions.SerializerSettings.ContractResolver = new AbpMvcJsonContractResolver(context.Services);
//});
}
public override void OnApplicationInitialization(ApplicationInitializationContext context)

Loading…
Cancel
Save