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? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -