コード例 #1
0
        public MARKDbContext CreateDbContext(string[] args)
        {
            var builder       = new DbContextOptionsBuilder <MARKDbContext>();
            var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder());

            MARKDbContextConfigurer.Configure(builder, configuration.GetConnectionString(MARKConsts.ConnectionStringName));

            return(new MARKDbContext(builder.Options));
        }
コード例 #2
0
 public override void PreInitialize()
 {
     if (!SkipDbContextRegistration)
     {
         Configuration.Modules.AbpEfCore().AddDbContext <MARKDbContext>(options =>
         {
             if (options.ExistingConnection != null)
             {
                 MARKDbContextConfigurer.Configure(options.DbContextOptions, options.ExistingConnection);
             }
             else
             {
                 MARKDbContextConfigurer.Configure(options.DbContextOptions, options.ConnectionString);
             }
         });
     }
 }