Hello ,
- I have write the following code in the "ConfigureServices" method :
services.AddMvc().AddJsonOptions(opt =>{
opt.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore;
opt.SerializerSettings.ContractResolver = new Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver();
});
- When I write "http://localhost/api/customer" . the data returns as CamelCase .
- What I need it to be dynamic if user writes http://localhost/api/customer?format=camel , the data will be returned as camel case . And if he writes http://localhost/api/customer?format=pascal , the data will be returned as pascal case .
how can we implement this ?
Thanks,
Ibrahim