DataContractJsonSerializer generating Ghost string to JSON keys?

Posted by Anil Namde on Stack Overflow See other posts from Stack Overflow or by Anil Namde
Published on 2010-05-21T12:37:39Z Indexed on 2010/05/21 12:40 UTC
Read the original article Hit count: 217

Filed under:
|
|
|

DataContractJsonSerializer this is nice class added in the .net framework which can be used to serialize/desirealize object into JSON.

Now following is the example i am trying

[Serializable] class User { public string name;     public string userId; }

Now following is the output generated

Output : Notice structure where only "name" is expected instead of k__BackingField

Now this is the problem after digging so much i am not sure from where <> and _BackingField is coming ?

{
"<name>k__BackingField":"test user",
"<userId>k__BackingField":100001}

© Stack Overflow or respective owner

Related posts about JSON

Related posts about ASP.NET