return from a linq where statement
- by Vaccano
I have the following link function
MyLinqToSQLTable.Where(x => x.objectID == paramObjectID).ToList();
I most of the time you can change a linq call to be several lines by adding curly brackets around the method body. Like this:
MyLinqToSQLTable.Where(x =>
{
x.objectID == paramObjectID;
}).ToList();
Problem is the implied return that was there when I just did a Boolean compare is now not done. Return (x.objectID == paramObjectID); is not accepted either.
How do do this? can I do this?
NOTE: I know that I can add another where clause if needed. But I would still like to know the answer to this.