Optimize Your EF Core Queries – Here's How

preview_player
Показать описание
EF Core is an ORM that offers a lot of benefits. However, benefits always come with a cost. One of the pain points when working with EF Core is to optimize queries. Such optimizations usually depend on a lot of variables like data quantity, data structure and it requires a lot of tweaking. Still, there are 3 easy ways to start optimizing your EF Core queries and most of us tend to get them wrong. But not anymore, as in this video we set proper foundations to understand EF Core query optimizations.
#EfCore #DotnetCore #dotnet

Join this channel to get access to perks:

Contents
1. Intro: 00:00
2. Projections: 02:16
3. Streaming vs buffering: 09:39
4. The change tracker: 21:24
5. Conclusions: 28:15
Рекомендации по теме
Комментарии
Автор

Regarding projections, this deserves its own video. All demonstrations of it that I have found are pretty trivial queries. But if your query is complex, with many joins (Include/ThenInclude) one-to-many relationships, and a lot of columns, you run into problems that are not discussed in these demonstrations.

I did not quite catch your mention of AutoMapper, but if it makes this projection technique easier for complex queries, then I am definitely interested.

johnnyvlee
Автор

Thank you for your videos! Not everybody explains these concepts as clear as you do. Great work.

TVfen
Автор

Very useful EF Core tricks. Thanks a lot for sharing.

sudidav
Автор

Dan, I enjoyed your video! It would be even better if you could cover Transactions for Insert/Update operations across multiple Entities and discuss business logic that involves data reading. Thanks for your content!"

MohiyoDeen
Автор

Nice video, I am interested in more EfCore performance videos.

mihaimyh
Автор

Thanks I really enjoyed everything you said.

ubongsky
Автор

There seems to be a lot of discussion about IQueryable. They say that we shouldn't expose it because it reveals to malicious user that he is in fact in direct contact with database. They also say that it's "leaky", I am not sure what they mean by that. What's your take on this?

TommiLipponen
Автор

Thank you so much. I would like to intrested to watch AutoMapper. Can you explain about indexes and Linq tutorial?

hmraja
Автор

Thank you for this video, Dan!! I recently an interviewer asked how to handle millions of records when using EF, my experience is kind of limited to only few thousands and was not able to respond. Do you have experience handling these kinds of scenarios?

victormoreno
Автор

i have one question what about if we return from the repo a collection ?

hamzahassani
Автор

Thanks helpful tips, Ive never used AsEnumerable. Would be good to have seen examples in real services in addition just for clarity. I've found lately i often cast direct to a dto from the dbconext.... E.g context.People.Select(p => new PersonDto() ... And have found myself not using auto mapper as much, so interested to see a vid on that.

RichardJohn
Автор

Hi, thanks for video. Give a advise please. If i have a big count of rows in database and i get them in for each cycle like
foreach (var item in context.Items) it is need a split it by chunks for avoiding sql query like "select * from table"?

semen