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