public MDR_AngularDbContext CreateDbContext(string[] args)
        {
            var builder       = new DbContextOptionsBuilder <MDR_AngularDbContext>();
            var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder());

            MDR_AngularDbContextConfigurer.Configure(builder, configuration.GetConnectionString(MDR_AngularConsts.ConnectionStringName));

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