Ejemplo n.º 1
0
        public BoilerplateDbContext Create(DbContextFactoryOptions options)
        {
            var builder       = new DbContextOptionsBuilder <BoilerplateDbContext>();
            var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder());

            BoilerplateDbContextConfigurer.Configure(builder, configuration.GetConnectionString(BoilerplateConsts.ConnectionStringName));

            return(new BoilerplateDbContext(builder.Options));
        }
Ejemplo n.º 2
0
 public override void PreInitialize()
 {
     if (!SkipDbContextRegistration)
     {
         Configuration.Modules.StudioXEfCore().AddDbContext <BoilerplateDbContext>(configuration =>
         {
             BoilerplateDbContextConfigurer.Configure(configuration.DbContextOptions, configuration.ConnectionString);
         });
     }
 }