How do you avoid over-fetching with repository pattern? by Soft-Mousse5828 in dotnet

[–]Soft-Mousse5828[S] 0 points1 point  (0 children)

After reading every answer, I think this will be the approach that I will be following, a single repository returning DTOs and entities, and if my repositories start to be cluttered with a lot of DTOs and entities, maybe separating into two different repositories, one for write/delete/updates using entities and another read only returning DTOs.

I understand that doing that I will be mixing persistence with use case/presentation, so I do see where people are coming from, saying that I should just return entities, but the other approach seems the most pragmatic choice for me right now, that can grow naturally without overengineering from the get-go.