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

            Project1DbContextConfigurer.Configure(builder, configuration.GetConnectionString(Project1Consts.ConnectionStringName));

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