Merge pull request #457 from strawd/aspnetwebstack-resources
[mono.git] / mcs / class / System.Core / System.Linq.Expressions / MethodCallExpression.cs
index 087c14bbb721f03704026ef8a331e4f8fe36a025..02718ffa055d354d3ec44bdbd20edee520ca2293 100644 (file)
 using System;
 using System.Collections.ObjectModel;
 using System.Reflection;
+using System.Reflection.Emit;
 
 namespace System.Linq.Expressions {
 
        public sealed class MethodCallExpression : Expression {
 
-               Expression @object;
+               Expression obj;
                MethodInfo method;
                ReadOnlyCollection<Expression> arguments;
 
                public Expression Object {
-                       get { return @object; }
+                       get { return obj; }
                }
 
                public MethodInfo Method {
@@ -50,17 +51,24 @@ namespace System.Linq.Expressions {
                        get { return arguments; }
                }
 
-               internal MethodCallExpression (Expression @object, MethodInfo method, ReadOnlyCollection<Expression> arguments)
+               internal MethodCallExpression (MethodInfo method, ReadOnlyCollection<Expression> arguments)
                        : base (ExpressionType.Call, method.ReturnType)
                {
-                       this.@object = @object;
+                       this.method = method;
+                       this.arguments = arguments;
+               }
+
+               internal MethodCallExpression (Expression obj, MethodInfo method, ReadOnlyCollection<Expression> arguments)
+                       : base (ExpressionType.Call, method.ReturnType)
+               {
+                       this.obj = obj;
                        this.method = method;
                        this.arguments = arguments;
                }
 
                internal override void Emit (EmitContext ec)
                {
-                       throw new NotImplementedException ();
+                       ec.EmitCall (obj, arguments, method);
                }
        }
 }