IEnumerable ans IQueryable in .NET
๐ก๐๐๐ง๐ฎ๐ฆ๐๐ซ๐๐๐ฅ๐ ๐๐ง๐ ๐๐๐ฎ๐๐ซ๐ฒ๐๐๐ฅ๐ ๐ข๐ง .๐๐๐
๐ก๐๐๐ง๐ฎ๐ฆ๐๐ซ๐๐๐ฅ๐ ๐๐ง๐ ๐๐๐ฎ๐๐ซ๐ฒ๐๐๐ฅ๐ ๐ข๐งย .๐๐๐
IEnumerable and IQueryable interfaces are both used to work with collections of data and both support LINQ (Language Integrated Query).
๐๐๐ฎ๐๐ซ๐ฒ๐๐๐ฅ๐
โ IQueryable executes queries on the server side.
โ It is designed specifically to work with LINQ
โ It extends IEnumerable, which means it includes all of the functionality of IEnumerable.
โ It can be more efficient when working with large data
โ It can be more helpful when you have to apply a lot of filtrations, you can apply all filters on Queryable and when you are done you can convert data to desired collection
๐๐๐ง๐ฎ๐ฆ๐๐ซ๐๐๐ฅ๐
โ๏ธ IEnumerable executes queries on the client side.
โ๏ธ It is generally used to work with in-memory data collections.
Explanation with code โคต๏ธ
If you like my work you can help me in growing through following ways
Subscribe my Weeklyย .NET Newsletter where I would be publishing one tip on C#/.NET on weekly basis.
You can Buy a Coffee for me.
#Iqueryable #IEnumerable #csharp #dotnet #dotnetcore #dotnet6