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

            CMS_AssignmentDbContextConfigurer.Configure(builder, configuration.GetConnectionString(CMS_AssignmentConsts.ConnectionStringName));

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