BestPractices: Is it acceptable to use more than one repository in a MVC-Controller?

后端 未结 4 1787
臣服心动
臣服心动 2020-12-31 10:45

I have a many-to-many assocition between an Employee and a Team. Foreach entity I have a repository.

Now I use ASP.NET MVC and I created a EmployeeController. I also

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-31 11:31

    It's quite OK, but once you feel that the Controller becomes too cluttered, you can refactor its dependencies to an Aggregate Service.

提交回复
热议问题