This is a strange behaviour of NewtonSoft serializer. By default when you serialize using JsonConvert.SerializeObject, it gives property name as Title case.
To convert Title case property to camelCase, we can use following code snippet.
Use below namespaces
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
var settings = new JsonSerializerSettings { ContractResolver = new CamelCasePropertyNamesContractResolver() };
return JsonConvert.SerializeObject(courses, Formatting.None, settings);
Notice that "courses" is my collection of objects here.
Hope this will be helpful.
Regards,
Sheo Narayan
http://www.dotnetfunda.com