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
Post a Comment