public static Expression CallCount(GroupedStage groupedStage) { var groupedCountMethod = CountWildcardMethod.MakeGenericMethod(groupedStage.ValueType); var call = Expression.Call( instance: null, method: groupedCountMethod, arguments: new Expression[] { groupedStage.ParameterExpression }); return(call); }
public static Expression CallSum(Expression expression, GroupedStage groupedStage) { var sumOutputType = GetSumOutputType(expression.Type); if (!Equals(sumOutputType, expression.Type)) { expression = Expression.Convert(expression, sumOutputType); } var sumMethod = GetSumMethod(sumOutputType); return(CallMethod(expression, sumMethod, groupedStage)); }
public BaseAggregationVisitor(GroupedStage previousStage, VisitorMetadata visitorMetadata) : base(previousStage, visitorMetadata) { _previousStage = previousStage; _visitorMetadata = visitorMetadata; }
public OrderByAggregationsVisitor(GroupedStage previousStage, VisitorMetadata visitorMetadata) : base(previousStage, visitorMetadata) { }
public SelectAggregationVisitor(GroupedStage previousStage, VisitorMetadata visitorMetadata) : base(previousStage, visitorMetadata) { //NOP }
public static Expression CallMethod(Expression expression, MethodInfo method, GroupedStage stage) { var groupedSumMethod = method.MakeGenericMethod(stage.ValueType); var argumentLambda = Expression.Lambda(expression, stage.ValueParameterExpression); var call = Expression.Call( instance: null, method: groupedSumMethod, arguments: new Expression[] { stage.ParameterExpression, argumentLambda }); return(call); }
public HavingVisitor(GroupedStage previousStage, VisitorMetadata visitorMetadata) : base(previousStage, visitorMetadata) { }