[英]How can I code up a LINQ query to check for more than one condition?
I have the following: 我有以下几点:
var pk = "001";
if (accounts.Any(b => b.Title.Equals(account.Title)))
What I would like to do is to also add a check that b.PartitionKey is not equal to a value I stored in a variable such as the variable pk. 我还想添加b.PartitionKey不等于我存储在变量pk等变量中的值的检查。 Is there a way that I can add this into the b => ??
有没有一种方法可以将其添加到b => ??中?
这个怎么样?
if (accounts.Any(b => b.Title.Equals(account.Title) && !b.PartitionKey.Equals(pk)))
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.