IList<T> to IQueryable<T>
-
09-06-2019 - |
Question
I have an List and I'd like to wrap it into an IQueryable.
Is this possible?
Solution
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
.
OTHER TIPS
Use the AsQueryable<T>()
extension method.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow