Exemple #1
0
        public SelectBuilder <T> OrderByDesc(Expression <Func <T, object> > parameter)
        {
            var param = QueryCreate.GetParameterName(parameter);

            AddStatement(QueryHelper.OrderBy(param, false));
            return(new SelectBuilder <T>(Build()));
        }
Exemple #2
0
        public SelectBuilder <T> Aggregate <T>(Expression <Func <T, object> > firstParameter,
                                               Expression <Func <T, object> >[] parameters, bool isCount) where T : class
        {
            var p1 = QueryCreate.GetParameterName(firstParameter);
            var p2 = string.Empty;

            if (parameters != null)
            {
                p2 = QueryCreate.GetParameterName(parameters);
            }

            return(isCount
                ? new SelectBuilder <T>(QueryHelper.SelectCount <T>(p1, p2))
                : new SelectBuilder <T>(QueryHelper.SelectMax <T>(p1, p2)));
        }
Exemple #3
0
 public SelectBuilder <T> Select <T>(params Expression <Func <T, object> >[] parameters)
     where T : class => new SelectBuilder <T>(QueryHelper.Select <T>(QueryCreate.GetParameterName(parameters)));