Example #1
0
        /// <summary>
        /// Application_s the start.
        /// </summary>
        protected void Application_Start()
        {
            try
            {
                InjectorInitializer.Initialize(ContainerProvider.Instance);
                var injector = new SimpleDependencyInjector();
                FluentValidationModelValidatorProvider.Configure(provider =>
                {
                    provider.ValidatorFactory = new FluentValidatorFactory(injector);
                });

                AreaRegistration.RegisterAllAreas();
                //InjectorInitializer.Initialize();
                WebApiConfig.Register(GlobalConfiguration.Configuration);
                FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
                FilterConfig.RegisterGlobalApiFilters(GlobalConfiguration.Configuration.Filters);
                RouteConfig.RegisterRoutes(RouteTable.Routes);
                BundleConfig.RegisterBundles(BundleTable.Bundles);
                AuthConfig.RegisterAuth();

                GlobalConfiguration.Configuration.Formatters.Add(new FormMultipartEncodedMediaTypeFormatter());
                GlobalConfiguration.Configuration.MessageHandlers.Add(new MessageLoggingHandler());
            }
            catch (Exception ex)
            {
                ex.ExceptionValueTracker();
            }
        }