Пример #1
0
        protected void Application_Start()
        {
            MiniProfilerEF6.Initialize();

            AreaRegistration.RegisterAllAreas();
            GlobalConfiguration.Configure(WebApiConfig.Register);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            //для валидации
            DataAnnotationsModelValidatorProvider.RegisterAdapter(typeof(DateValidationAttribute), typeof(DateValidator));

            DependencyResolver.SetResolver(new AutofacDependencyResolver(AutofacBuilder.GetContainer()));
            GlobalConfiguration.Configuration.DependencyResolver = new AutofacWebApiDependencyResolver(AutofacBuilder.GetContainer());

            SqlDependencyAdmin.InitialSqlDependencyDataBase();
            ModelMapper.InitializeConfigMapper();
        }