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

            RQCoreDbContextConfigurer.Configure(builder, configuration.GetConnectionString(RQCoreConsts.ConnectionStringName));

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