如何取得 Func 对象 字段

namespace ConsoleApplication2
{
    class Program
    {
        class Customer
        {
            public int id;
            public string name;
        }
        class Helper<T>
        {
            public void OrderBy<TKey>(Func<T, TKey> keySelector)
            {
                //Type t = typeof(TKey);
                //var b = t.GetProperties();
                //Type t = keySelector.GetType();
                //var k = keySelector.GetInvocationList();
                //var p = t.GetProperties();
                //在这里我如何取得 是 Customer id 这个字段 ??
                throw new NotImplementedException();
            }
        }
        static void Main(string[] args)
        {
            Helper<Customer> h = new Helper<Customer>();
            h.OrderBy(p => p.id);
            Console.Read();
        }
    }
}

 

 
posted @ 2011-05-14 16:10  一浩瀚星空一  阅读(242)  评论(0编辑  收藏  举报