Corrected Code on Counting how many fruits are red (#32722)

Corrected the expression that was used on Where clause.
This commit is contained in:
Willy David Jr
2019-07-05 11:54:44 -07:00
committed by Randell Dawson
parent 12d4cc83ab
commit 39990df1f3
+1 -1
View File
@@ -29,7 +29,7 @@ Then we can do things like:
var firstName = fruits.Select(f => f.Name).First(); // Orange
// Count how many fruits are red
var qntRed = fruits.Where(Color == "Red").Count(); // 2
var qntRed = fruits.Where(f => f.Color == "Red").Count(); // 2
// Create a list of yellow fruits
var yellowFruits = fruits.Where(f => f.Color == "Yellow").ToList(); // { Pineapple, Mango }