1
0
mirror of https://github.com/rudollee/LearningMVC.git synced 2025-06-07 16:06:21 +00:00

Lambda Adv

This commit is contained in:
wook 2017-04-03 02:40:29 +09:00
parent 6f8592883d
commit 63ae566736

View File

@ -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;
foreach (Product prod in products.Filter(categoryFileter))
foreach (Product prod in products.Filter(prod => prod.Category == "Soccer" || prod.Price > 20))
{
total += prod.Price;
}