How do I test if a Linq to SQL query returns no rows?
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).
加载中,请稍侯......
精彩评论