e.g. 5.20 A Lambda Expression Without a Func

This commit is contained in:
Jason Zhu 2021-07-12 13:33:48 +10:00
parent c95b347b15
commit 0e57f0e2e8

View File

@ -21,8 +21,7 @@ namespace automatically_implemented_properties
}
};
Func<Product, bool> categoryFilter = prod => prod.Category == "Soccer";
IEnumerable<Product> filteredProducts = products.Filter(categoryFilter);
IEnumerable<Product> filteredProducts = products.Filter(prod => prod.Category == "Soccer");
foreach (Product prod in filteredProducts)
{