public T Update(T entity)
            {
                // Load full graph from the db
                var loadedEntity = _service.Find(_cache._repository.As <IMetaDataProvider>().BuildPrimaryKeyExpression(entity));

                // Update entity and cache
                return(loadedEntity != null?_cache.Update(loadedEntity) : null);
            }
Example #2
0
 public T Find(Expression <Func <T, bool> > criteria)
 {
     try
     {
         return(_service.Find(criteria));
     }
     catch (Exception ex)
     {
         if (_logger != null)
         {
             _logger(ex);
         }
         if (_failoverService == null || _strategy == FailoverStrategy.ReplicationOnly)
         {
             throw;
         }
         return(_failoverService.Find(criteria));
     }
 }
Example #3
0
 public T Find(Expression <Func <T, bool> > criteria)
 {
     criteria = new Specification <T>(CastRemoverVisitor <ITenant> .Convert(_filter)).And(criteria).Predicate;
     return(_service.Find(criteria));
 }
Example #4
0
 public T Find(Expression <Func <T, bool> > criteria)
 {
     return(_service.Find(criteria));
 }