C# - How to remove k__BackingField from json when Deserialize?

I am getting the k_BackingField in my returned json after serializing a xml file to a .net c# object.

I've added the DataContract and the DataMember attribute to the .net c# object but then I get nothing on the json, client end.

public class LinkedIn
   public string ID { get; set; }

    public string Industry { get; set; }

    public string FirstName { get; set; }

    public string LastName { get; set; }

Example of the returned json:

home: Object
<FirstName>k__BackingField: "Storefront"
<LastName>k__BackingField: "Doors"


Remove [Serializable] from your class.

Mirror from

StackOverflow - How to remove k__BackingField from json when Deserialize - https://stackoverflow.com/questions/13022198/how-to-remove-k-backingfield-from-json-when-deserialize/27796357#27796357

Previous Post Next Post