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