How to implement Unit of work in MVC: Responsibility

前端 未结 4 1603
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-12 09:08

Who has the responsability


Who has the responsibility to start and finish the Unit of work in a MVC architecture?

4条回答
  •  借酒劲吻你
    2021-01-12 09:40

    I am a believer in loosely coupled architecture. My controller knows NOTHING about the repository, context or unitofwork. I have created a service layer (not sure that is the right term) that the controller calls. This service then works with the repository (dll) to persist all data.

提交回复
热议问题