Пример #1
0
        public DOTICDbContext CreateDbContext(string[] args)
        {
            var builder       = new DbContextOptionsBuilder <DOTICDbContext>();
            var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder(), addUserSecrets: true);

            DOTICDbContextConfigurer.Configure(builder, configuration.GetConnectionString(DOTICConsts.ConnectionStringName));

            return(new DOTICDbContext(builder.Options));
        }
Пример #2
0
 public override void PreInitialize()
 {
     if (!SkipDbContextRegistration)
     {
         Configuration.Modules.AbpEfCore().AddDbContext <DOTICDbContext>(options =>
         {
             if (options.ExistingConnection != null)
             {
                 DOTICDbContextConfigurer.Configure(options.DbContextOptions, options.ExistingConnection);
             }
             else
             {
                 DOTICDbContextConfigurer.Configure(options.DbContextOptions, options.ConnectionString);
             }
         });
     }
 }
        public override void PreInitialize()
        {
            if (!SkipDbContextRegistration)
            {
                Configuration.Modules.AbpEfCore().AddDbContext <DOTICDbContext>(options =>
                {
                    if (options.ExistingConnection != null)
                    {
                        DOTICDbContextConfigurer.Configure(options.DbContextOptions, options.ExistingConnection);
                    }
                    else
                    {
                        DOTICDbContextConfigurer.Configure(options.DbContextOptions, options.ConnectionString);
                    }
                });
            }

            //Uncomment below line to write change logs for the entities below:
            //Configuration.EntityHistory.Selectors.Add("DOTICEntities", typeof(OrganizationUnit), typeof(Role), typeof(Tenant));
        }
Пример #4
0
        public override void PreInitialize()
        {
            if (!SkipDbContextRegistration)
            {
                Configuration.Modules.AbpEfCore().AddDbContext <DOTICDbContext>(options =>
                {
                    if (options.ExistingConnection != null)
                    {
                        DOTICDbContextConfigurer.Configure(options.DbContextOptions, options.ExistingConnection);
                    }
                    else
                    {
                        DOTICDbContextConfigurer.Configure(options.DbContextOptions, options.ConnectionString);
                    }
                });
            }

            // Uncomment below line to write change logs for the entities below:
            //Configuration.EntityHistory.Selectors.Add("DOTICEntities", EntityHistoryHelper.TrackedTypes);
            //Configuration.CustomConfigProviders.Add(new EntityHistoryConfigProvider(Configuration));
        }