Пример #1
0
        /// <inheritdoc />
        public virtual TQuery GroupBy(Expression <Func <TSource, object> > property)
        {
            if (property != null)
            {
                IProjection projection = ProjectionHelper
                                         .GetProjection
                                         (
                    property.Body,
                    new HelperContext(Data, property, HelperType.GroupBy)
                                         );

                if (projection != null)
                {
                    if (projection.IsGrouped || projection.IsAggregate)
                    {
                        throw new InvalidOperationException(
                                  "Cannot use an aggregate or grouped projection with GroupBy");
                    }

                    GroupBys.Add(new FqGroupByProjection(projection, false));
                }
            }

            return(Query);
        }
Пример #2
0
 public QueryExpression GroupBy(params string[] propertyNames)
 {
     foreach (string propertyName in propertyNames)
     {
         GroupBys.Add(propertyName);
     }
     return(this);
 }
Пример #3
0
 public QueryExpression GroupBy(params IPropertyExpression[] propertys)
 {
     foreach (IPropertyExpression property in propertys)
     {
         GroupBys.Add(new GroupExpression(property.PropertyName));
     }
     return(this);
 }
Пример #4
0
 public void AdicionarAgrupamento(string agrupamento)
 {
     GroupBys.Add(agrupamento);
 }
Пример #5
0
 public void AppendGroupBy(IQueryableColumn groupByColumn)
 {
     GroupBys.Add(groupByColumn);
 }