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