Beispiel #1
0
 public IEnumerable <T> FindAll(Expression <Func <T, bool> > criteria, int offset = 0, int limit = 0, Sorting <T> orderBy = null)
 {
     try
     {
         return(_service.FindAll(criteria, offset, limit, orderBy));
     }
     catch (Exception ex)
     {
         if (_logger != null)
         {
             _logger(ex);
         }
         if (_failoverService == null || _strategy == FailoverStrategy.ReplicationOnly)
         {
             throw;
         }
         return(_failoverService.FindAll(criteria, offset, limit, orderBy));
     }
 }
            public IEnumerable <T> FindAll(Expression <Func <T, bool> > criteria, int offset = 0, int limit = 0, Expression <Func <T, object> > orderBy = null)
            {
                // Reduce invalid cache combinations
                if (offset < 0)
                {
                    offset = 0;
                }
                if (limit < 0)
                {
                    limit = 0;
                }

                var       key = _cache.CacheKey(criteria, offset, limit, orderBy, _paths);
                IList <T> items;

                if (!_cache.Cache.Get(key, out items))
                {
                    items = _service.FindAll(criteria, offset, limit, orderBy).ToArray();
                    _cache.Cache.Set(key, items);
                }
                return(items);
            }
 public IEnumerable <T> FindAll(Expression <Func <T, bool> > criteria, int offset = 0, int limit = 0, Sorting <T> orderBy = null)
 {
     criteria = new Specification <T>(CastRemoverVisitor <ITenant> .Convert(_filter)).And(criteria).Predicate;
     return(_service.FindAll(criteria, offset, limit, orderBy));
 }
Beispiel #4
0
 public IEnumerable <T> FindAll(Expression <Func <T, bool> > criteria, int offset = 0, int limit = 0, Expression <Func <T, object> > orderBy = null)
 {
     return(_service.FindAll(criteria, offset, limit, orderBy));
 }