I have a linq query such as
.where(x => (x.Title.Contains(text) || x.Comments.Contains(text)))
If I run the code and the first part (x.Title.Contains(text)) has a hit, the code runs fine... if I run the code and the first part wouldn't have a hit... it seems the second part is blowing up and causing an exception now. I'm specifically getting a null reference exception.
It's like the first part of the query is stripping the set down to nothing, and the second part is attempting to query against that? That's the cause for the exception?
Or might I have a problem elsewhere in the code and the linq query is actually fine?