Sep 21, 2024
Yeah UoW is not as neat of a pattern when using EF. Although it was all the rage 10 years ago 😅.
I always stick to taking the dbcontext in my repos and that's been enough for every single project.
The only reason I can think of, is if you want to do something like stub the dbContext, if I remember correctly this can be quite complex to get right, so keeping it at an arms length away by abstraction it out even further might be beneficial... But patterns just for the sake of testing often become anti patterns. You are writing code for domain problems not for unit tests, so to speak.