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

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