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
Post a Comment