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

            FRMSCoreDbContextConfigurer.Configure(builder, configuration.GetConnectionString(FRMSCoreConsts.ConnectionStringName));

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