DbMethodCallExpression.cs 1.0 KB

12345678910111213141516171819202122232425262728293031
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Collections.ObjectModel;
  4. using System.Reflection;
  5. namespace Ant.DbExpressions
  6. {
  7. public class DbMethodCallExpression : DbExpression
  8. {
  9. DbExpression _object;
  10. MethodInfo _method;
  11. ReadOnlyCollection<DbExpression> _arguments;
  12. public DbMethodCallExpression(DbExpression @object, MethodInfo method, IList<DbExpression> arguments)
  13. : base(DbExpressionType.Call)
  14. {
  15. this._object = @object;
  16. this._method = method;
  17. this._arguments = new ReadOnlyCollection<DbExpression>(arguments);
  18. }
  19. public ReadOnlyCollection<DbExpression> Arguments { get { return this._arguments; } }
  20. public MethodInfo Method { get { return _method; } }
  21. public DbExpression Object { get { return _object; } }
  22. public override Type Type { get { return this.Method.ReturnType; } }
  23. public override T Accept<T>(DbExpressionVisitor<T> visitor)
  24. {
  25. return visitor.Visit(this);
  26. }
  27. }
  28. }