コード例 #1
0
            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);
            }
コード例 #2
0
ファイル: FailoverRepostiory.cs プロジェクト: yarutyunov/Yarn
 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));
     }
 }
コード例 #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));
 }
コード例 #4
0
 public T Find(Expression <Func <T, bool> > criteria)
 {
     return(_service.Find(criteria));
 }