Beispiel #1
0
 public Setting GetDefaultSetting()
 {
     if (!CacheManager.Contains("SettingService_GetDefaultSetting"))
     {
         var setting = AllCacheItems.Where(x => x.IsDefault).SingleOrDefault();
         CacheManager.AddOrUpdate("SettingService_GetDefaultSetting", setting);
     }
     return(CacheManager.GetData <Setting>("SettingService_GetDefaultSetting"));
 }
Beispiel #2
0
 public override IQueryable <T> Query(string predicate, string orderBy = null, string[] includeSelectors = null)
 {
     if (string.IsNullOrEmpty(orderBy))
     {
         return(AllCacheItems.AsQueryable().Where(predicate));
     }
     else
     {
         return(AllCacheItems.AsQueryable().Where(predicate).OrderBy(orderBy));
     }
 }
Beispiel #3
0
 public override bool Contains(Expression <Func <T, bool> > predicate)
 {
     return(AllCacheItems.AsQueryable().Count(predicate) > 0);
 }
Beispiel #4
0
 public override T Single(Expression <Func <T, bool> > expression, string[] includeSelectors = null)
 {
     return(AllCacheItems.AsQueryable().Where(expression).SingleOrDefault());
 }