예제 #1
0
        public InvManSaasDbContext CreateDbContext(string[] args)
        {
            var builder       = new DbContextOptionsBuilder <InvManSaasDbContext>();
            var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder());

            InvManSaasDbContextConfigurer.Configure(builder, configuration.GetConnectionString(InvManSaasConsts.ConnectionStringName));

            return(new InvManSaasDbContext(builder.Options));
        }
 public override void PreInitialize()
 {
     if (!SkipDbContextRegistration)
     {
         Configuration.Modules.AbpEfCore().AddDbContext <InvManSaasDbContext>(options =>
         {
             if (options.ExistingConnection != null)
             {
                 InvManSaasDbContextConfigurer.Configure(options.DbContextOptions, options.ExistingConnection);
             }
             else
             {
                 InvManSaasDbContextConfigurer.Configure(options.DbContextOptions, options.ConnectionString);
             }
         });
     }
 }