AggregateQueryExpression.cs 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. using Ant.Query.QueryState;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Collections.ObjectModel;
  5. using System.Linq;
  6. using System.Linq.Expressions;
  7. using System.Reflection;
  8. using System.Text;
  9. namespace Ant.Query.QueryExpressions
  10. {
  11. class AggregateQueryExpression : QueryExpression
  12. {
  13. MethodInfo _method;
  14. ReadOnlyCollection<Expression> _parameters;
  15. public AggregateQueryExpression(QueryExpression prevExpression, MethodInfo method, IList<Expression> parameters)
  16. : base(QueryExpressionType.Aggregate, method.ReturnType, prevExpression)
  17. {
  18. this._method = method;
  19. this._parameters = new ReadOnlyCollection<Expression>(parameters);
  20. }
  21. public MethodInfo Method { get { return this._method; } }
  22. public ReadOnlyCollection<Expression> Parameters { get { return this._parameters; } }
  23. public override T Accept<T>(QueryExpressionVisitor<T> visitor)
  24. {
  25. return visitor.Visit(this);
  26. }
  27. }
  28. }