public ServiceTriggerDbContext CreateDbContext(string[] args)
        {
            var builder       = new DbContextOptionsBuilder <ServiceTriggerDbContext>();
            var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder());

            ServiceTriggerDbContextConfigurer.Configure(builder, configuration.GetConnectionString(ServiceTriggerConsts.ConnectionStringName));

            return(new ServiceTriggerDbContext(builder.Options));
        }
Exemplo n.º 2
0
 public override void PreInitialize()
 {
     if (!SkipDbContextRegistration)
     {
         Configuration.Modules.AbpEfCore().AddDbContext <ServiceTriggerDbContext>(options =>
         {
             if (options.ExistingConnection != null)
             {
                 ServiceTriggerDbContextConfigurer.Configure(options.DbContextOptions, options.ExistingConnection);
             }
             else
             {
                 ServiceTriggerDbContextConfigurer.Configure(options.DbContextOptions, options.ConnectionString);
             }
         });
     }
 }