✅ How to get data from entity without includes?
I have this:
Is it possible to achive the same but without using a lot of includes?
6 Replies
you can with projection but it might ended up in a longer code, if u make some mapping extension it might be shorter and it might also be better to write some DTOs at this point
specially if u dont need every single column from your tables and included tables like you're doing right now for better performance.
thanks for helping
by the way, if we talk about perfomance how good is it compared to join tables?
join i mean include
well the way you have right now, imagine if you have a table with 200 columns that references another table with 500 columns you will be retrieving all those 700 columns per item
however if u only need say
shift id, name, resource type you only retrieving 3 columns
so yeah the impact can be huge
as for number benchmark every case is a caseEfficient Querying - EF Core
Performance guide for efficient querying using Entity Framework Core
hm, understood
thanks for helping me
I will use dto instead of includes
If you have no further questions, please use /close to mark the forum thread as answered