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

            FargateDemoDbContextConfigurer.Configure(builder, configuration.GetConnectionString(FargateDemoConsts.ConnectionStringName));

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