Below is code fragments
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
namespace DetailTest
{
class Program
{
static void Main(string[] args)
{
A a = new A();
PropertyInfo pi = a.GetType().GetProperty("cs");
MemberInfo[] mis = pi.PropertyType.GetMembers();
MemberInfo[] mis2 = mis.Where(d => d.Name.StartsWith("A")).ToArray();
foreach (MemberInfo mi in mis2)
{
Console.WriteLine(mi);
}
}
}
class A
{
B _b = new B();
public B b { get{return _b;}}
public List<C> cs{get;set;}
}
}
I just want to get Any
method, but I got nothing. Why?
I mean how to get Any method of List type?
ps: I really reference System.Linq