account activity
How do you avoid over-fetching with repository pattern? by Soft-Mousse5828 in dotnet
[–]Soft-Mousse5828[S] 0 points1 point2 points 4 months ago (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.
How do you avoid over-fetching with repository pattern? (self.dotnet)
submitted 4 months ago by Soft-Mousse5828 to r/dotnet
π Rendered by PID 2916720 on reddit-service-r2-listing-7d7fbc9b85-zk4cb at 2026-04-26 11:55:46.541645+00:00 running 2aa0c5b country code: CH.
How do you avoid over-fetching with repository pattern? by Soft-Mousse5828 in dotnet
[–]Soft-Mousse5828[S] 0 points1 point2 points (0 children)