IList< T>到IQueryable< T> [英] IList<T> to IQueryable<T>
本文介绍了IList< T>到IQueryable< T>的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个列表,我想将其包装到一个IQueryable中.
I have an List and I'd like to wrap it into an IQueryable.
这可能吗?
推荐答案
List<int> list = new List<int>() { 1, 2, 3, 4, };
IQueryable<int> query = list.AsQueryable();
如果看不到AsQueryable()
方法,请为System.Linq
添加using语句.
If you don't see the AsQueryable()
method, add a using statement for System.Linq
.
这篇关于IList< T>到IQueryable< T>的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文