Linq how to only return when all meet a condition? -


i want loop on list of objects , check boolean value until true return.

is possible linq??

in other words:

list of < obj {1, true}, obj {1, false}, obj {1, false}, obj {1, false} >

but bool being updated else , want check bool until true return control.

how linq?

thanks!

you can return boolean value using .any() indicate of values false in collection.

while( yourcollection.any(q => q.booleanvariable == false)) { } 

this run until of variables set true.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

keyboard - C++ GetAsyncKeyState alternative -

android - java.net.UnknownHostException(Unable to resolve host “URL”: No address associated with hostname) -