Created
July 2, 2015 11:25
-
-
Save fontanka16/6cf708a14e818eccac14 to your computer and use it in GitHub Desktop.
WebAPiConfig.cs add JsonConverer
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 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