I have around 30 entities. I use ajax call to retrieve data from database using entity framework. We have requirement to use the the same column name as in database's table. However ajax get the response and property display in camel case.
public Class ABC
{
public string RT_ID { get; set; }
public string START_DATE { get; set; }
}
the JSON response shows rtId and startDate corresponding for RT_ID and START_DATE .
However JSON response show RT_ID and START_DATE, I use JsonPropertyName attribute against each property.
public Class ABC
{
[JsonPropertyName("RT_ID")]
public string RT_ID { get; set; }
[JsonPropertyName("START_DATE")]
public string START_DATE { get; set; }
}
So the challenge is, Can I have same property name in JSON response without adding JsonPropertyName to each property of the class. May be at class level ?
Thanks