Enumerable.Empty<T>() equivalent for IQueryable
When a method returns IEnumerable<T>
and I do not have anything to return, we can use Enumerable.Empty<T>()
.
Is there an equivalent to the above for a method returning IQueryable<T>
Maybe:
Enumerable.Empty<T>().AsQueryable();
Enumerable.Empty<T>().AsQueryable();
should do it.
Try return new T[0].AsQueryable();