-5

Proper difference of IEnumreable and IQueryable .

Why this two interface used and when used?

Whats the benefit used over list?

What other methods consist in IEnumreable and IQueryable?

In what scenario we have to use IEnumreable and IQueryable?

  • IQueryable hasnt run the query yet. The difference between list and ienumerable : [link](http://stackoverflow.com/questions/3628425/ienumerable-vs-list-what-to-use-how-do-they-work) – thsorens Apr 15 '14 at 12:11
  • http://blogs.msdn.com/b/erickt/archive/2006/10/23/iqueryable-t-vs-ienumerable-t.aspx – Ramin Asadi Apr 15 '14 at 12:13
  • 5
    Hi, this is not a interview question and answer site. You should try google or read the documentation. – Gaurav Pandey Apr 15 '14 at 12:14

1 Answers1

1

When querying a database, I prefer using a IQueryable because the request is sent when data are needed. I mean this

   var users = (from user in db.Users select user ).AsQueryable();
   //it doesn't load data yet until you write users.ToList(); or users.Count();
Bellash
  • 7,560
  • 6
  • 53
  • 86