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

Dynamic Mega Menu With Asp.Net with c#,java script and Sql Server.

Bootstrap Modal Popup keep open on PostBack in ASP.Net

Export div content to PDF Using ITextSharp in asp.net