// public T getSingle(Expression <Func <T, bool> > whereCondition, Func <IQueryable <T>, IOrderedQueryable <T> > orderBy = null) { try { var query = _objectset.AsExpandable().Where(whereCondition); if (orderBy != null) { return(orderBy(query).FirstOrDefault <T>()); } else { return(query.FirstOrDefault <T>()); } } catch (Exception ex) { UtilLog.saveError(ex, this._objectset.ToString()); } return(null); }
/// <summary> /// Retorna todos os objetos que satisfaçam a cláusula passada /// </summary> public IQueryable <E> ObterSomenteComPredicado(Expression <Func <E, bool> > where) { try { return(dbSet.AsExpandable().Where(where)); } catch (Exception) { return(null); } }
public int Count(Expression <Func <T, bool> > expression) { return(Set.AsExpandable().Where(expression).Count()); }
public IEnumerable <T> FindBy(Expression <Func <T, bool> > predicate) { return(dbSet.AsExpandable().Where(predicate)); }
public IEnumerable <T> FindBy(System.Linq.Expressions.Expression <Func <T, bool> > predicate) { return(DbSet.AsExpandable().Where(predicate)); }