221

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

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

Add a reference to: System.Linq

Max
  • 12,622
  • 16
  • 73
  • 101
Greg Beech
  • 133,383
  • 43
  • 204
  • 250
  • 10
    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