IEnumerable VS IQueryable (in .NET Core)

preview_player
Показать описание
IEnumerable is an interface that exposes an enumerator. And an enumerator is used for iteration of a generic collection (or array). The class that implements IEnumerable is responsible for exposing the enumerator and providing its implementation.

IQueryable interface on the other hand, is intended to be implemented by data providers. IQueryable provides functionality to execute queries against a specific data source. And IQueryable is derived from IEnumerable.

Data access ORM (Object Relational Mapper) framework like Entity Framework Core exposes the implementation of IQueryable.

In this video, I will walk through creating a console application. And the application will use Entity Framework Core to access Employee table from a database. I will also add logging in the Entity Framework Core, to see actual queries fired against the database.

Once the code is executed, I will compare the difference in the query when we access the data using an IQueryable interface versus an IEnumerable interface.
Рекомендации по теме
Комментарии
Автор

Excellent video, it's very well grounded by using a simple Console app to demo the concept, and by starting by creating a new project in Visual Studio. I can't stand when people demo a concept by opening some large project that only they are familiar with, and then expect everyone to instantly understand and follow along. So kudos to you, this made all the difference for me.

codefoxtrot
Автор

Thank you. You just clear my years of confusion.

md.shamswadudabbir
Автор

Thank you so much for this brother. You're a natural when it comes to explaining things

musa
Автор

Thank you! Much appreciated. Got stuck on hot project and this was exactly what I needed.

CyberAbyss
Автор

Thanks, a beginner questions? why doe you annotate a table?

oneworldnoborders
Автор

Thanks for your effort
but how you wrote the take() method in another line after the query but when it executed, we saw them in the same query?

mohamedmahmoudkamel
Автор

Thnx Man, you are explain great things . Keep going on

gamal