Relative Content

Tag Archive for c#asp.netdatabaseentity-framework-coreunit-of-work

Right implementation Unit of Work pattern

I want to implement Unit of Work for my ecommerce shop project, but I don’t understand and can’t find how to make it so repositories are gonna be generic and anytime I want to create new model my generic repository don’t violate Interface segregation principle. If, for example, I create new model, and I don`t need Update implementation it will be added anyway. I know that I can make all my repo calls in services and then only save changes in UnitOfWork, also if I will not create generic repo, I will be violating open closed principle. Here generic repo

Right implementation Unit of Work pattern

I want to implement Unit of Work for my ecommerce shop project, but I don’t understand and can’t find how to make it so repositories are gonna be generic and anytime I want to create new model my generic repository don’t violate Interface segregation principle. If, for example, I create new model, and I don`t need Update implementation it will be added anyway. I know that I can make all my repo calls in services and then only save changes in UnitOfWork, also if I will not create generic repo, I will be violating open closed principle. Here generic repo