Exemplo n.º 1
0
        public TEntity GetSingleOrderByDescending(Expression <Func <TEntity, TKey> > keySelector,
                                                  Expression <Func <TEntity, bool> > predicate)
        {
            var queryCriteria = new ExpressionQuery <TEntity>();

            queryCriteria.OrderByDescending(keySelector);
            if (predicate != null)
            {
                queryCriteria.And(predicate);
            }

            var find = queryCriteria.Execute(Set);

            return(find.FirstOrDefault());
        }