lbueno
❔ Why "Controller’s methods calls the infrastructure layer" is a bad practice?
I received this feedback in a technical assessment. The program was a ASP.NET Core API. I had a Repository layer calling Entity Framework. The repositories were injected in the controllers and from there I called repositories methods. For example, I called a "CanPost" method that would determine the rest of the workflow in the controller.
What should I have done instead? Thanks
25 replies