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

            GraceDbContextConfigurer.Configure(builder, configuration.GetConnectionString(GraceConsts.ConnectionStringName));

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

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