Exemple #1
0
 public static SelectExpression RemoveGroupExpression(this SelectExpression select, Expression expression)
 {
     if (select.GroupBy != null && select.GroupBy.Count > 0)
     {
         var groupby = new List <Expression>(select.GroupBy);
         groupby.Remove(expression);
         return(select.SetGroupBy(groupby));
     }
     return(select);
 }
Exemple #2
0
        public static SelectExpression AddGroupExpression(this SelectExpression select, Expression expression)
        {
            var groupby = new List <Expression>();

            if (select.GroupBy != null)
            {
                groupby.AddRange(select.GroupBy);
            }
            groupby.Add(expression);
            return(select.SetGroupBy(groupby));
        }