Enumerable.Empty<T>() equivalent for IQueryable

Numan picture Numan · Apr 22, 2010 · Viewed 24.7k times · Source

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>

Answer

Sunny picture Sunny · Apr 22, 2010

Maybe:

Enumerable.Empty<T>().AsQueryable();