Rename Property from Deserialized Javascript
问题 How do I take deserialize JavaScript and change the name of the property being processed? For example: class MyClass { public string CreateDate {get;set;} } public class DeserializeMyClass { //How do I take "create_date" and convert it to CreateDate? Is there an attribute I //can use? var json = @"{""create_date"":""04/12/2013""}"; var ds = new JavaScriptSerializer(); ds.Deserialize<MyClass>(json); } Thanks in advance! 回答1: Looks like you can't do it easily for JavaScriptSerializer, but you