I have a LINQ Query which returns a Boolean.
Boolean status=true;
var s = from p in msg where p.Type == false select false;
im required to set status from the value from the LINQ query which is a boolean how to take a approach to this
If the LINQ query has a single false i need to return a false as Boolean thats what i need
At the moment assumign p has lots of msgs then s is going to be an enumerable with zero to lots of falses in. You might want to consider a different operator like
Or better thanks to Ray in comments:
Any returns true if the condition is satisfied by anything in p. All returns true if the condition is satisfied in all of them (and will thus immediately return if it finds one that doesn’t match).
Alternatively with your code you could just do:
If your s is empty (no falses in it) then it will return true, if it has one or more falses it will return false.