Beispiel #1
0
        public void GetGenericMethod_RunTest3()
        {
            MethodInfo method = LambdaUtils.GetGenericMethodDefinition(() => new[] { 1 }.Contains(1));

            Assert.NotNull(method);
        }
Beispiel #2
0
        public void GetGenericMethod_RunTest()
        {
            MethodInfo method = LambdaUtils.GetGenericMethodDefinition <IEnumerable <int> >(x => x.Any(y => true));

            Assert.NotNull(method);
        }
Beispiel #3
0
        public void GetGenericMethod_RunTest2()
        {
            MethodInfo method = LambdaUtils.GetGenericMethodDefinition <IEnumerable <int> >(x => x.Contains(1));

            Assert.NotNull(method);
        }
Beispiel #4
0
 /// <summary>尋找 Lambda Expression tree 中的 Generic Definition MethodInfo</summary>
 public static MethodInfo GetGenericMethodDefinition(this Expression expr)
 {
     return(LambdaUtils.GetGenericMethodDefinition(expr));
 }