namespace PetRescue.Web.Api
{
    using System.Reflection;
    using System.Web;
    using System.Web.Http;
    using System.Web.Mvc;

    using Newtonsoft.Json.Converters;

    using Web.Infrastructure.Mapping;

    public class WebApiApplication : HttpApplication
    {
        protected void Application_Start()
        {
            AutofacConfig.RegisterAutofac();
            DatabaseConfig.Initialize();
            GlobalConfiguration.Configuration.Formatters.JsonFormatter.SerializerSettings.Converters.Add(new StringEnumConverter());
            GlobalConfiguration.Configure(WebApiConfig.Register);

            var autoMapperConfig = new AutoMapperConfig();
            autoMapperConfig.RegisterMappings(Assembly.GetExecutingAssembly());
        }
    }
}
