Beispiel #1
0
        public FintrakERPIMSDemoDbContext CreateDbContext(string[] args)
        {
            var builder       = new DbContextOptionsBuilder <FintrakERPIMSDemoDbContext>();
            var configuration = AppConfigurations.Get(
                WebContentDirectoryFinder.CalculateContentRootFolder(),
                addUserSecrets: true
                );

            FintrakERPIMSDemoDbContextConfigurer.Configure(builder, configuration.GetConnectionString(FintrakERPIMSDemoConsts.ConnectionStringName));

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

            // Set this setting to true for enabling entity history.
            Configuration.EntityHistory.IsEnabled = false;

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