public DefaultDbConfiguration()
        {
            IDatabaseInitializer <DefaultDbContext> databaseInitializer;

            if (GlobalConfig.AutomaticMigrationsEnabled)
            {
                databaseInitializer = new MigrateDatabaseToLatestVersion <DefaultDbContext, Configuration>();
                SetContextFactory(typeof(DefaultDbContext), () =>
                {
                    var work = new HttpContextWrapper(HttpContext.Current).Request.RequestContext.GetWorkContext();
                    return(work.Resolve <EntityFrameworkDbContextFactory>().Create());
                });
            }
            else
            {
                databaseInitializer = new NullDatabaseInitializer <DefaultDbContext>();
            }

            SetDatabaseInitializer(databaseInitializer);
        }