I have a simple lambda expression that goes something like this:
x=> x.Lists.Include(l => l.Title).Where(l=>l.Title != String.Empty)
Now, if I want to add one more where clause to the expression, say, l.InternalName != String.Empty
then what would the expression be?
Can be
or
When you are looking at
Where
implementation, you can see it accepts aFunc(T, bool)
; that means:T
is your IEnumerable typebool
means it needs to return a boolean valueSo, when you do
The lambda you pass to
Where
can include any normal C# code, for example the&&
operator:Maybe
?
You can probably also put it in the same where clause:
or
You can include it in the same where statement with the && operator...
You can use any of the comparison operators (think of it like doing an if statement) such as...
...would bring back 3 and 10.