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

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

    Yes, it's perfectly acceptable for a controller to have references to two repositories.

    In fact, my controllers work with multiple repositories more often than not.

提交回复
热议问题