开发者

How do I test if a Linq to SQL query returns no rows?

开发者 https://www.devze.com 2023-02-08 14:49 出处:网络
How do I test if a Linq to SQL query returns no r开发者_开发百科ows?The .Any() LINQ operator: results.Any()

How do I test if a Linq to SQL query returns no r开发者_开发百科ows?


The .Any() LINQ operator:

results.Any()

Returns false if there are no rows.


You can use results.Any(); (the Queryable.Any method).

0

精彩评论

暂无评论...
验证码 换一张
取 消