c# - Can this be done entirely via linq? -


i have process identity rows in list (unmatchedclient) call separate method delete them (pingtree.removenodes). seems little long winded , acheive same thing merely setting value of property "deleteflag" true. how set value using linq?

var unmatchedclient = pingtree.nodes.where(x =>     _application.loanamount < x.lender.minloanamount ||     _application.loanamount > x.lender.maxloanamount ||     _application.loanterm < x.lender.minloanterm ||     _application.loanterm > x.lender.maxloanterm) .select(x => x.treenode) .tolist();  pingtree.removenodes(unmatchedclient); 

thanks in advance.

like this?

pingtree.nodes.where(x =>         _application.loanamount < x.lender.minloanamount ||         _application.loanamount > x.lender.maxloanamount ||         _application.loanterm < x.lender.minloanterm ||         _application.loanterm > x.lender.maxloanterm)         .select(x => x.treenode)         .tolist()         .foreach(n=> n.deleteflag = true); 

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -