#491 Per @bajtos,
It would be nice to introduce app.repository API to take care of this.
There should be a way to bind multiple repositories (implementation tbd) -- This is just a shorthand of bind().toClass.
Implementation Suggestion: Introspect the name of the repository and use that as the key. User can also supply a string the repository should bind to (similar to how .bind() works).
Acceptance
app.repository(AccountRepository);
The argument should be strongly typed to a base Repository interface, which is something that we cannot achieve via bind().toClass(), at least not now.
Instead of importing the repository class and binding it to a key on the app instance.
app.bind('repositories.account').toClass(AccountRepository);
@bajtos feel free to edit if I misunderstood.
#491 Per @bajtos,
There should be a way to bind multiple repositories (implementation tbd) -- This is just a shorthand of bind().toClass.
Implementation Suggestion: Introspect the name of the repository and use that as the key. User can also supply a string the repository should bind to (similar to how .bind() works).
Acceptance
app.repository(AccountRepository)app.repository()) otherwise add new tests.Instead of importing the repository class and binding it to a key on the
appinstance.@bajtos feel free to edit if I misunderstood.