Articles → CSHARP → Difference Between The Iqueryable And Ienumerable In C#
Difference Between The Iqueryable And Ienumerable In C#
Ienumerable
- IEnumerable interface exists in System.Collection namespace.
- IEnumerable is suitable for in-memory collections like array, list etc.
- IEnumerable loads all the data from the server and then filters the data.
- IEnumerable is suitable for LINQ to Object or LINQ to SQL.
Iqueryable
- IQueryable interface exists in System.LINQ namespace.
- IQueryable is suitable for remote databases and services.
- IQueryable filters the data from the server and then loads the data.
- IQueryable is suitable for LINQ to SQL.