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