Exemplo n.º 1
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            GlobalConfiguration.Configure(WebApiConfig.Register);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            SimpleInjectorWebApiInitializer.Initialize();

#if !DEBUG
            System.Data.Entity.Database.SetInitializer <Tesseract.DA.AuthorsDBContext>(new System.Data.Entity.MigrateDatabaseToLatestVersion <Tesseract.DA.AuthorsDBContext, Tesseract.DA.Migrations.Configuration>());

            Tesseract.DA.AuthorsDBContext authorsDBContext = new AuthorsDBContext(ConfigurationManager.ConnectionStrings["AuthorContext"].ConnectionString);
            authorsDBContext.Database.Initialize(true);

            System.Data.Entity.Database.SetInitializer <Tesseract.DA.AuthorsDBContext>(null);
#endif
        }
 public ArticleRepository(AuthorsDBContext context, UnitOfWork unitOfWork)
     : base(context, unitOfWork)
 {
 }
Exemplo n.º 3
0
 public UnitOfWork(IConfig config)
 {
     dbContext = new AuthorsDBContext(config.ConnectionString);
 }