public ChopstickDockerDbContext CreateDbContext(string[] args) { var builder = new DbContextOptionsBuilder <ChopstickDockerDbContext>(); var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder()); ChopstickDockerDbContextConfigurer.Configure(builder, configuration.GetConnectionString(ChopstickDockerConsts.ConnectionStringName)); return(new ChopstickDockerDbContext(builder.Options)); }
public override void PreInitialize() { if (!SkipDbContextRegistration) { Configuration.Modules.AbpEfCore().AddDbContext <ChopstickDockerDbContext>(options => { if (options.ExistingConnection != null) { ChopstickDockerDbContextConfigurer.Configure(options.DbContextOptions, options.ExistingConnection); } else { ChopstickDockerDbContextConfigurer.Configure(options.DbContextOptions, options.ConnectionString); } }); } }