前面我也說了不少了,這次把這個東西源代碼拿出來,不做解釋了。這里放幾張圖說明一下效果:
首先,這是用到的測試類:
namespace ConsoleLenic
{
public class Person
{
public Person(long id, string name)
{
ID = id;
Name = name;
}
public long ID { get; set; }
public string Name { get; set; }
public string Format()
{
return ID + " " + Name;
}
}
}
這是字符串轉 Lambda 表達式展示:
來個強悍點的:
上面的這兩張圖,都可以用源碼實現。
不寫了,這個寫疲了。