public void GetGenericMethod_RunTest3() { MethodInfo method = LambdaUtils.GetGenericMethodDefinition(() => new[] { 1 }.Contains(1)); Assert.NotNull(method); }
public void GetGenericMethod_RunTest() { MethodInfo method = LambdaUtils.GetGenericMethodDefinition <IEnumerable <int> >(x => x.Any(y => true)); Assert.NotNull(method); }
public void GetGenericMethod_RunTest2() { MethodInfo method = LambdaUtils.GetGenericMethodDefinition <IEnumerable <int> >(x => x.Contains(1)); Assert.NotNull(method); }
/// <summary>尋找 Lambda Expression tree 中的 Generic Definition MethodInfo</summary> public static MethodInfo GetGenericMethodDefinition(this Expression expr) { return(LambdaUtils.GetGenericMethodDefinition(expr)); }