Reference Article: https://blog.csdn.net/u010178308/article/details/77681573

When using LINQ statements, a collection of IEnumerable source will be generated. When querying whether the collection is empty, source.count() is generally used for connection query, but for LINQ statements, count cannot return the value we want.

Any()

When querying with LINQ statements, use if(!source.Any()) to check if the collection is empty.