Created
January 8, 2014 07:39
-
-
Save akunzai/8313166 to your computer and use it in GitHub Desktop.
OrderedContractResolver
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Newtonsoft.Json; | |
using Newtonsoft.Json.Serialization; | |
public class OrderedContractResolver : DefaultContractResolver { | |
protected override System.Collections.Generic.IList<JsonProperty> CreateProperties(System.Type type, MemberSerialization memberSerialization) { | |
return base.CreateProperties(type, memberSerialization).OrderBy(p => p.PropertyName).ToList(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment