Skip to content

Instantly share code, notes, and snippets.

@beachside-project
Created April 15, 2016 11:11
Show Gist options
  • Save beachside-project/bedb72fe952d686bb74e027c792c8e5d to your computer and use it in GitHub Desktop.
Save beachside-project/bedb72fe952d686bb74e027c792c8e5d to your computer and use it in GitHub Desktop.
jsonDemo JsonSerializableModel
public abstract class JsonSerializable
{
private static readonly JsonSerializerSettings Settings = new JsonSerializerSettings
{
ContractResolver = new CamelCasePropertyNamesContractResolver()
};
public string ToJsonString() => JsonConvert.SerializeObject(this, Settings);
public string ToJsonString(JsonSerializerSettings settings) => JsonConvert.SerializeObject(this, settings);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment