I'm try to serialise an C# object to json by using Newtonsoft.Json.Serialization but it's returning name of properties as Pascal-case.
For an example consider the following C# class:
public class Person
{
public string FirstName { get; set; }
public string LastName { get; set; }
}
By default, when returning an instance of this class from a class as JSON, it'll be serialized in the following fashion:
{
"FirstName": "Me",
"LastName": "Public"
}
I would like it to be serialized as:
{
"firstName": "Me",
"lastName": "Public"
}
I'm using C# code as:
var json = JsonConvert.SerializeObject(myPerson);
Views:
5487
Total Answered:
1
Total Marked As Answer:
0
Posted On:
09-Jul-2020 00:07