protected override Expression VisitPropertyAccess(PropertyAccessExpression expr) { string name = MemberNameVisitor.GetMemberName(_rootCriteria, expr); _projections.Add(NHProjections.GroupProperty(name)); return(expr); }
protected override NewExpression VisitNew(NewExpression expr) { NewExpression newExpr = base.VisitNew(expr); _transformer = new TypeSafeConstructorMemberInitResultTransformer(expr); var aggregators = expr.Arguments.Where(arg => arg is MethodCallExpression && SupportsMethod(((MethodCallExpression)arg).Method.Name)); if (aggregators.Any()) { foreach (var exp in expr.Arguments.Except(aggregators)) { string propertyName = MemberNameVisitor.GetMemberName(_rootCriteria, exp); if (!String.IsNullOrEmpty(propertyName)) { _projections.Add(NHProjections.GroupProperty(propertyName)); } } } return(newExpr); }
public PropertyProjection Group() { return(Projections.GroupProperty(PropertyName)); }
/// <summary> /// A grouping property value /// </summary> public static PropertyProjection Group(Expression <Func <object> > expression) { return(Projections.GroupProperty(ExpressionProcessor.FindMemberExpression(expression.Body))); }