public void FastCompiledOK() { var executor = ObjectMethodExecutorCompiledFast.Create(_t.GetMethod(TestMethodName), _ti); Assert.IsNotNull(executor); Assert.IsTrue(executor.IsMethodAsync); var sumTask = (Task <int>)executor.Execute(this, new object[] { 1, 2 }); Assert.AreEqual(3, sumTask.Result); var sum = executor.ExecuteAsync(this, new object[] { 1, 2 }); Assert.AreEqual(3, sum.GetAwaiter().GetResult()); }
public object CompileFast() => ObjectMethodExecutorCompiledFast.Create(_t.GetMethod(nameof(Foo)), _t.GetTypeInfo());
public static ObjectMethodExecutorCompiledFast GetExecutor(MethodInfo meth) { return(ObjectMethodExecutorCompiledFast.Create(meth, meth.DeclaringType.GetTypeInfo())); }