Originally when I was throwing this together, I was just slapping files in places. Well, if you take a step back and look at how this unfolded, the router contains business logic for various entities that had to be copy/pasted into other routes of related entities. That logic should be in the repository layer and the router should just be checking authentication/authorization and building up a data access context to initialize the repositories with.
Originally when I was throwing this together, I was just slapping files in places. Well, if you take a step back and look at how this unfolded, the
router
contains business logic for various entities that had to be copy/pasted into other routes of related entities. That logic should be in the repository layer and the router should just be checking authentication/authorization and building up a data access context to initialize the repositories with.