Ejemplo n.º 1
0
        public AspNetCoreAngularDbContext CreateDbContext(string[] args)
        {
            var builder       = new DbContextOptionsBuilder <AspNetCoreAngularDbContext>();
            var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder());

            AspNetCoreAngularDbContextConfigurer.Configure(builder, configuration.GetConnectionString(AspNetCoreAngularConsts.ConnectionStringName));

            return(new AspNetCoreAngularDbContext(builder.Options));
        }
Ejemplo n.º 2
0
 public override void PreInitialize()
 {
     if (!SkipDbContextRegistration)
     {
         Configuration.Modules.AbpEfCore().AddDbContext <AspNetCoreAngularDbContext>(options =>
         {
             if (options.ExistingConnection != null)
             {
                 AspNetCoreAngularDbContextConfigurer.Configure(options.DbContextOptions, options.ExistingConnection);
             }
             else
             {
                 AspNetCoreAngularDbContextConfigurer.Configure(options.DbContextOptions, options.ConnectionString);
             }
         });
     }
 }