How can I check if Linq returns any rows in the SQL query?

How to check if a Linq to SQL query returns a row?

+4
source share
2 answers

The .Any() LINQ statement:

 results.Any() 

Returns false if there are no rows.

+8
source

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

0
source

Source: https://habr.com/ru/post/1338594/


All Articles