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