views:

1788

answers:

2

I have an List and I'd like to wrap it into an IQueryable.

Is this possible?

+17  A: 
List<int> list = new List<int>() { 1, 2, 3, 4, };
IQueryable<int> query = list.AsQueryable();
pb
Cheers, I was hoping it would be a one liner.
Squirrel
+3  A: 

Use the AsQueryable() extension method.

Chris Shaffer