I have a small LINQ query containing a Where clause; sort of:
var blueRedGreenBikes = GetBikes(filter)
.Where(a => a.Color == "Blue" || a.Color == "Red" || a.Color == "Green")
.Count()
I am looking for a way to write this type of query more briefly using LINQ. In SQL, I could write a similar WHERE clause, for example:
WHERE bike.Color IN ('Red','Blue','Green')
source
share