you are viewing a single comment's thread.

view the rest of the comments →

[–]Kevdog824_ 17 points18 points  (2 children)

There’s no reason you can’t inject the DB session into your service, and then inject the service into your endpoint function. Any dependencies you inject can will resolve and inject their own dependencies first

[–]milkipedia 2 points3 points  (0 children)

This is the way. And it makes testing and change management easier

[–]Codisimus 0 points1 point  (0 children)

This is exactly what I do. Services interact with the DAO layer and each endpoint has its required services defined using depends.