tags:

views:

31

answers:

3

It's possible to do the following:

IEnumerable<Person> people = Enumerable.Empty<Person>();

Is there an equivalent for IQueryable...?

IQueryable<Person> people = Queryable.Empty<Person>();
+3  A: 

try with this:

Enumerable.Empty<Person>().AsQueryable();
anishmarokey
+1  A: 

As you have already probably noticed there is no Queryable.Empty extension method. You can simulate this by using other extensions methods, such as Where:

var empty = collection.Where(c => false);
Steven
A: 

calling AsQueryable on the Empty Enumerable?

Damien_The_Unbeliever