|
使用Lambda表達式將會造成Lambda表達式主題部分的代碼重復.
1. var allEmployees = new List<Employee>() {
2. new Employee {
3. EmployeeId = 1, Classification = 1, FirstName = "Skin", LastName = "Sen" } };
4. var earlyFolks = from e in allEmployees
5. where e.MonthlySalary < 4000 && e.Classification == 1 && e.YearsOfService > 20
6. select e;
NET技術:【More Effective C#】Lambda表達式優化,轉載需保留來源!
鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。