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