Created
September 26, 2016 19:12
-
-
Save weeksdev/cc759f31f5a4ce8bf7c3a5340ede9081 to your computer and use it in GitHub Desktop.
Global Web Api Config
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; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Web; | |
using System.Web.Http; | |
using System.Web.Security; | |
using System.Web.SessionState; | |
namespace TestyMesty | |
{ | |
public class Global : System.Web.HttpApplication | |
{ | |
protected void Application_Start(object sender, EventArgs e) | |
{ | |
var formatters = GlobalConfiguration.Configuration.Formatters; | |
var jsonFormatter = formatters.JsonFormatter; | |
var settings = jsonFormatter.SerializerSettings; | |
settings.Formatting = Newtonsoft.Json.Formatting.Indented; | |
settings.ContractResolver = new Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver(); | |
GlobalConfiguration.Configure(x => x.MapHttpAttributeRoutes()); | |
//AreaRegistration.RegisterAllAreas(); | |
GlobalConfiguration.Configuration.IncludeErrorDetailPolicy = IncludeErrorDetailPolicy.Always; | |
} | |
protected void Session_Start(object sender, EventArgs e) | |
{ | |
} | |
protected void Application_BeginRequest(object sender, EventArgs e) | |
{ | |
} | |
protected void Application_AuthenticateRequest(object sender, EventArgs e) | |
{ | |
} | |
protected void Application_Error(object sender, EventArgs e) | |
{ | |
} | |
protected void Session_End(object sender, EventArgs e) | |
{ | |
} | |
protected void Application_End(object sender, EventArgs e) | |
{ | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment