I've a json data like the following which I'm getting from API. { "Location Code": "0000", "Main Image": "MainImage124", "Hero Image": "HeroImage2344", "City": "City1" }
I've a model class like following
`public class Class1 {
public string LocationCode { get; set; }
public string MainImage { get; set; }
public string HeroImage { get; set; }
public string City { get; set; }
}`
I'm deserializing the api data using Newtonsoft.Json. But I'm missing the data for LocationCode, MainImage and HeroImage. I can see the data for City. I guess it's b'coz of the space in the property "Location Code" in json data.
How to remove the white spaces in Json Property (in this case the property name is "Location Code").
Please advise me on.
Or Is there any reason why the data is missing for LocationCode, MainImage and HeroImage after deserialization?