Beispiel #1
0
        public ReactAbpProjectDbContext CreateDbContext(string[] args)
        {
            var builder       = new DbContextOptionsBuilder <ReactAbpProjectDbContext>();
            var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder());

            ReactAbpProjectDbContextConfigurer.Configure(builder, configuration.GetConnectionString(ReactAbpProjectConsts.ConnectionStringName));

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