IList to IQueryable

前端 未结 2 415
长情又很酷
长情又很酷 2020-12-01 12:07

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

Is this possible?

2条回答
  •  一生所求
    2020-12-01 12:14

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

    If you don't see the AsQueryable() method, add a using statement for System.Linq.

提交回复
热议问题