I want my asp.net web api to return json response with space in property names, currently when i am testing it using postman i am getting response in the below format.
[
{
"appId": 1,
"appName": "app1"
},
{
"appId": 2,
"appName": "app2"
}
]
But I would like my web api to return the response in the below format because in the FE i am reading the column names dynamically and displaying as it it just by converting it to uppercase
[
{
"appId": 1,
"app Name": "app1"
},
{
"appId": 2,
"app Name": "app2"
}
]
To achieve this i tried converting my model to below format.
public class MyApp
{
public int AppId {get; set;}
[JsonProperty(PropertyName = " App Name")]
public string AppName {get; set;}
}
But still i see my Api returning response property as appName
How can i get the json property with space in between ?