You can also check the .Any()
method:
if (!YourResult.Any())
Just a note that .Any
will still retrieve the records from the database; doing a .FirstOrDefault()/.Where()
will be just as much overhead but you would then be able to catch the object(s) returned from the query