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

            ResponsibleSystemDbContextConfigurer.Configure(builder,
                                                           configuration.GetConnectionString(AppConfig.ConnectionStringName));

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