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

后端 未结 4 1791
臣服心动
臣服心动 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:22

    Wanna go smart? Do not use repositories inside controllers whatsoever. Instead use Domain Services. It doesn't sound so bad when you think one controller integrates the work of many services doesn't it?

提交回复
热议问题