Ejemplo n.º 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);
 }
Ejemplo n.º 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));
        }