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