top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration

Facebook Login
Site Registration

What are the differences between IEnumerable and IQueryable in C#?

0 votes
53 views
What are the differences between IEnumerable and IQueryable in C#?
posted Mar 31, 2017 by Amit Sharma

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

IEnumerable:
1. It belongs to System.Collections namespace.
2. IEnumerable is the best way to write query on collections data type like list,array etc.
3. IEnumerable is the return type for LINQ to object and LINQ to XML queries.
4. IEnumerable does not support lazy loading.So it's not recommended approach for paging scenarios.
5. It supports extension methods.

IQueryable
1. IQueryable belongs to System.Linq namespace.
2. IQueryable is the best way to write query on data like remote database,service collections etc.
3. IQueryable is the return type for LINQ to SQL queries.
4. IQueryable support lazy loading.So it can be used for paging scenarios.

answer Mar 31, 2017 by Shweta Singh
Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...