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

            DotnetAngularDemoDbContextConfigurer.Configure(builder, configuration.GetConnectionString(DotnetAngularDemoConsts.ConnectionStringName));

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