I have an Azure Function V4. It is a Http triggered function returning IActionResult. My expectation of the output JSON should be property names matching exact letter casing of property names of the C# class. but the JSON serialization converts property names to camel case and lower case.
I want the JSON object property names letter casing to exactly match that of the C# class member names of that model.
C# Object
public string JobId { get; set; }
public List<Contact> Contacts { get; set; }
public Tags Tags { get; set; }
public class Contact
{
public string firstName { get; set; }
}
public class Tags
{
public string GROUPCONTACT { get; set; }
}
JSON result Actual
{
"jobId": null,
"contacts": [
{
"firstName": "dummy"
}
],
"tags": {
"groupcontact": "dummy"
}
}
Expected JSON result
{
"JobId": null,
"Contacts": [
{
"firstName": "dummy"
}
],
"Tags": {
"GROUPCONTACT": "dummy"
}
}