forked from jpreecedev/BookStoreAPI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGlobal.asax.cs
26 lines (23 loc) · 868 Bytes
/
Global.asax.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
namespace BooksAPI
{
using System.Data.Entity;
using System.Web;
using System.Web.Http;
using Core;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
public class WebApiApplication : HttpApplication
{
protected void Application_Start()
{
GlobalConfiguration.Configure(WebApiConfig.Register);
GlobalConfiguration.Configure(FilterConfig.Configure);
Database.SetInitializer(new Initializer());
var formatters = GlobalConfiguration.Configuration.Formatters;
var jsonFormatter = formatters.JsonFormatter;
var settings = jsonFormatter.SerializerSettings;
settings.Formatting = Formatting.Indented;
settings.ContractResolver = new CamelCasePropertyNamesContractResolver();
}
}
}