public int Sum(int first, int second) { var method = typeof(IHandWritten).GetMethod("Sum"); var arguments = new object[] { first, second }; var invocation = new InvocationT<int>(this, invocationHandler, method, null, arguments, args => target.Sum((int)args.Arguments[0], (int)args.Arguments[1])); return invocationHandler.InvokeT(invocation); }
public string GetString() { var method = typeof(IHandWritten).GetMethod("GetString"); var arguments = new object[0]; var invocation = new InvocationT<string>(this, invocationHandler, method, null, arguments, args => target.GetString()); return invocationHandler.InvokeT(invocation); }
public int Sum(int first, int second) { var method = typeof(IHandWritten).GetMethod("Sum"); var arguments = new object[] { first, second }; var invocation = new InvocationT <int>(this, invocationHandler, method, null, arguments, args => target.Sum((int)args.Arguments[0], (int)args.Arguments[1])); return(invocationHandler.InvokeT(invocation)); }
public string GetString() { var method = typeof(IHandWritten).GetMethod("GetString"); var arguments = new object[0]; var invocation = new InvocationT <string>(this, invocationHandler, method, null, arguments, args => target.GetString()); return(invocationHandler.InvokeT(invocation)); }