我有一个过程,我在列表中标识行(unmatchedClient),然后调用一个单独的方法来删除它们(pingtree.RemoveNodes)。这似乎有点冗长,我可以通过仅将属性“DeleteFlag”的值设置为 true 来实现相同的目标。但是如何使用 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);
提前致谢。