public static void EnableViewCache()
        {
            if (!DataAccess.Configuration.Database.EnableViewCache) return;

            using (var ctx = new EntityContext())
            {
                InteractiveViews.SetViewCacheFactory(ctx, new SqlServerViewCacheFactory(ctx.Database.Connection.ConnectionString));
            }
        }
        public static void Seed(EntityContext context)
        {
            // Create users

            context.TryAddUser(Configuration.DefaultUserUsername, "*****@*****.**", "User", "Account", false, Configuration.DefaultPassword);
            context.TryAddUser(Configuration.DefaultAdminUsername, Configuration.DefaultEmail, "Admin", "Account", true, Configuration.DefaultPassword);

            // Create 500 products

            for (var i = 1; i < 500; i++)
            {
                context.TryAddProduct(Company.Name(), Lorem.Sentence(), RandomNumber.Next(0, 1000));
            }
        }
 public static void Seed(EntityContext context)
 {
 }
 public RepositoryFacade(EntityContext context)
 {
     Condition.Requires(context, "context").IsNotNull();
     _context = context;
 }