0

what is the basic difference between System.Linq.IQueryable and System.Collections.Generic.List which one is faster and when to use what?

Muneeb Zulfiqar
  • 1,003
  • 2
  • 13
  • 31

1 Answers1

0

An IQueryable<T> is an interface which abstracts some type of query. This query can be executed (by iterating over the query), but you have to use ToList<T> to convert (the results of) the query into a list.

A List<T> is just a list which can contain some objects. Ready for you to be retrieved when you need them.

Maarten
  • 22,527
  • 3
  • 47
  • 68