How to remove k__BackingField from Json data
2013-08-27 09:59
411 查看
当用DataContractJsonSerializer类序列化对象为Json时,发现序列化后的json对象,每个属性都带有k__BackingField后缀,像这样:
解决办法:为要被序列化的类打上相应标记,像下面这样:
[Serializable] [DataContract] public class Person { private string _name; [DataMember] public string Name { get { return _name; } set { _name = value; } } }
参考:http://forums.asp.net/t/1903020.aspx/1
相关文章推荐
- How to remove k__BackingField from Json data
- Spring Boot MongoDB How to remove _class from spring data mongodb collection
- How to Properly Remove Datastore or LUN from ESXi 5.x hosts
- How to Properly Remove Datastore or LUN from ESXi 5.x hosts
- How to fix: Recieve error "Unable to display this Web Part" on Data Views after restoring site from backup
- php 怎样去掉一个string 后面的一个或多个字符(how to remove the last n chars from a string)?
- How to retreive raw post data from HttpServletRequest in java
- How to use JSon data in mvc action and post form data use JQuery ajax
- How to Recover from a Lost or Deleted Datafile with Different Scenarios [ID 198640.1]
- how to remove file and commit from history(如何移除 commit 歷史紀錄)
- vSphere Howto: Remove a LUN from an ESXi server
- Google Volley: How to send a POST request with Json data?
- From Galileo to Google: How Big Data Illuminates Human Culture
- How to remove Oracle Database from your computer---By Roger Gong
- How To Replace jQuery 1.9.1's $.parseJSON function with the implementation from jQuery 1.8.3
- How to get date from OAMessageDateFieldBean
- How to read data from csv file in c#
- how to separate index from data tablespace
- How to extract data from ContentHolder in Windc...
- How to dynamically set limit_choices_to for ManyToManyField using values from an instance? - Google Groups