Our Play application uses Slick as a data access layer. This means that in almost every action in our app we need to have both the current Request
and Slick's database Session
implicitly available on the scope.
I want to write a custom Action
to do this so we only need one line to do this. What I want to do is write it in such a way that I can write something like this:
def someAction = DBAction { implicit request, session =>
// body with implicit request and session on scope
But this is not valid syntax. Using a tuple does not work because it cannot implicitly unpack the tuple in action body. Is it possible to create a custom action that passes multiple implicit arguments to the body? How do I do this?