Ejemplo n.º 1
0
        public MyEventCloudDbContext CreateDbContext(string[] args)
        {
            var builder       = new DbContextOptionsBuilder <MyEventCloudDbContext>();
            var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder());

            MyEventCloudDbContextConfigurer.Configure(builder, configuration.GetConnectionString(MyEventCloudConsts.ConnectionStringName));

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