public AutoRiceMillDbContext CreateDbContext(string[] args)
        {
            var builder       = new DbContextOptionsBuilder <AutoRiceMillDbContext>();
            var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder());

            AutoRiceMillDbContextConfigurer.Configure(builder, configuration.GetConnectionString(AutoRiceMillConsts.ConnectionStringName));

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