5.1.6 Using Lambda Expression
e.g. 5.22 Extending the Filtering Expression by Lambda
This commit is contained in:
parent
0e57f0e2e8
commit
a376175c76
@ -21,7 +21,9 @@ namespace automatically_implemented_properties
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
IEnumerable<Product> filteredProducts = products.Filter(prod => prod.Category == "Soccer");
|
IEnumerable<Product> filteredProducts = products.Filter(prod =>
|
||||||
|
prod.Category == "Soccer" ||
|
||||||
|
prod.Price > 20);
|
||||||
|
|
||||||
foreach (Product prod in filteredProducts)
|
foreach (Product prod in filteredProducts)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user