Skip to content

Instantly share code, notes, and snippets.

@fontanka16
Created July 2, 2015 11:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fontanka16/6cf708a14e818eccac14 to your computer and use it in GitHub Desktop.
Save fontanka16/6cf708a14e818eccac14 to your computer and use it in GitHub Desktop.
WebAPiConfig.cs add JsonConverer
using System.Web.Http;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using Viola.CallSlipFetching;
using ViolaGui.Filters;
namespace ViolaGui
{
public static class WebApiConfig
{
public static void Register(HttpConfiguration config)
{
/* Other stuff goes here*/
var formatters = GlobalConfiguration.Configuration.Formatters;
var jsonFormatter = formatters.JsonFormatter;
var settings = jsonFormatter.SerializerSettings;
settings.Converters.Add(new CallSlipDeliveryTypeConverter());
settings.Formatting = Formatting.Indented;
settings.ContractResolver = new CamelCasePropertyNamesContractResolver();
/* Other stuff goes also here*/
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment