Ejemplo n.º 1
0
        protected void Application_Start()
        {
            Database.SetInitializer <MyNotebookDbContext>(new MyNotebookDbInitializer());

            AreaRegistration.RegisterAllAreas();
            GlobalConfiguration.Configure(WebApiConfig.Register);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);
            LoggingConfig.RegisterLoggingSources(new List <EventSource> {
                SiteEventSource.Log, DomainEventSource.Log
            },
                                                 (ISiteSettings)NinjectWebCommon.Kernel.GetService(typeof(ISiteSettings)));
        }
Ejemplo n.º 2
0
        protected void Application_Start()
        {
            // Create database.
            Database.SetInitializer <ApplicationDbContext>(new ApplicationDbInitializer());
            ApplicationDbContext db = new ApplicationDbContext();

            db.Database.Initialize(true);

            // Init logging.
            LoggingConfig.RegisterLoggingSources(new List <EventSource> {
                WebEventSource.Log, DataEventSource.Log
            },
                                                 (ICommonSettings)NinjectWebCommon.Kernel.GetService(typeof(ICommonSettings)));

            AreaRegistration.RegisterAllAreas();

            WebApiConfig.Register(GlobalConfiguration.Configuration);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);
            AuthConfig.RegisterAuth();
        }