问题
I have an List and I'd like to wrap it into an IQueryable.
Is this possible?
回答1:
List<int> list = new List<int>() { 1, 2, 3, 4, };
IQueryable<int> query = list.AsQueryable();
If you don't see the AsQueryable()
method, add a using statement for System.Linq
.
回答2:
Use the AsQueryable<T>()
extension method.
来源:https://stackoverflow.com/questions/73542/ilistt-to-iqueryablet