从IList <T>到IQueryable <T>


Answers:


113
List<int> list = new List<int>() { 1, 2, 3, 4, };
IQueryable<int> query = list.AsQueryable();

如果看不到该AsQueryable()方法,请为添加一个using语句System.Linq


1
如果您对长途感兴趣,可以执行以下操作:从查询中的q选择q或list.Select(q => q)也会为您提供IQueryable <T>
Nick Daniels

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.