示例#1
0
        public MasknDbContext Create(DbContextFactoryOptions options)
        {
            var builder       = new DbContextOptionsBuilder <MasknDbContext>();
            var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder());

            MasknDbContextConfigurer.Configure(builder, configuration.GetConnectionString(MasknConsts.ConnectionStringName));

            return(new MasknDbContext(builder.Options));
        }
 public override void PreInitialize()
 {
     if (!SkipDbContextRegistration)
     {
         Configuration.Modules.AbpEfCore().AddDbContext <MasknDbContext>(configuration =>
         {
             MasknDbContextConfigurer.Configure(configuration.DbContextOptions, configuration.ConnectionString);
         });
     }
 }