208

Possible Duplicate:
IList<T> to IQueryable<T>

I have a List data, but I want a IQueryable data , is it possible from List data to IQueryable data? Show me code

Community
  • 1
  • 1

1 Answers1

465
var list = new List<string>();
var queryable = list.AsQueryable();

Add a reference to: System.Linq

Max
  • 11,885
  • 15
  • 70
  • 96
Greg Beech
  • 128,213
  • 43
  • 201
  • 246
  • 7
    Yes, definitely NOT `.ToQueryable()` which, silly me, kept thinking is what it would, if not should be. :facepalm: – Scott Fraley Jul 10 '19 at 20:09