Created
August 15, 2020 08:11
-
-
Save ssukhpinder/3c0accf4e0d268774f380434cc61b9fa to your computer and use it in GitHub Desktop.
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
public class LowerCaseResolver<T> : DefaultContractResolver | |
{ | |
protected override JsonProperty CreateProperty(MemberInfo member, MemberSerialization memberSerialization) | |
{ | |
JsonProperty property = base.CreateProperty(member, memberSerialization); | |
if (property.DeclaringType == typeof(T)) | |
{ | |
property.PropertyName = property.PropertyName.ToLower(); | |
} | |
return property; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment