Resolved Issue in Asp core 3.0 serializersettings does not exist in AddJsonOptions



Hello,

When we want to use serializersettings  function in configure service (IN startup .cs) for CamelCasing .then we get this issue  in asp core 3.0. So we can resolve it by adding below code in configure service file



 public void ConfigureServices(IServiceCollection services)
        {
           
            services.AddMvc(setupAction => {
                setupAction.EnableEndpointRouting = false;
            }).AddJsonOptions(jsonOptions =>
            {
                jsonOptions.JsonSerializerOptions.PropertyNamingPolicy = null;
            })
        .SetCompatibilityVersion(CompatibilityVersion.Version_3_0);

Comments

Popular posts from this blog

Bootstrap Modal Popup keep open on PostBack in ASP.Net

.Net most asked interview questions for experienced professionals (C#,Asp WEBFORM,MVC,ASP CORE,WEB API,SQL Server,Java Script,Jquery)