mirror of
https://github.com/rudollee/LearningMVC.git
synced 2025-06-07 16:06:21 +00:00
Lambda Adv
This commit is contained in:
parent
6f8592883d
commit
63ae566736
@ -80,11 +80,11 @@ namespace LanguageFeatures.Controllers
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Func<Product, bool> categoryFileter = prod => prod.Category == "Soccer";
|
//Func<Product, bool> categoryFileter = prod => prod.Category == "Soccer";
|
||||||
|
|
||||||
decimal total = 0;
|
decimal total = 0;
|
||||||
|
|
||||||
foreach (Product prod in products.Filter(categoryFileter))
|
foreach (Product prod in products.Filter(prod => prod.Category == "Soccer" || prod.Price > 20))
|
||||||
{
|
{
|
||||||
total += prod.Price;
|
total += prod.Price;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user