I have the following query:
var req= (from tl in resultlist
where (tl.Message.StartsWith("Do not return") && tl.Type == "Int") &&
(tl.Note.StartsWith("Do no return") && tl.Type == "Ext")
select tl).Any();
I am trying to see if there are records where Message starts with “Do not return” and Type is “Int”
and there is another message where Note start with “Do no return” and Type is “Ext”.
Seems like my query is wrong as not returning anything.
This will ensure that in the result set there are some “Do not return” messages which start with
"Int"AND in the same result set are some other messages which start with “Ext”The function (the condition in query) checks if the source element meets some requirements so if you check for the same object’s Type to be “Int” and “Ext” is not possible, since can’t have two string values in the same time.
On the other hand you need to find out if in the resultlist exist items of two different types or for two exclusive conditions, so this it can’t be done in a single iteration (each LINQ query is an iterator in the end..).