I can't find right words for my question so i will let my code speak instead.
I have Repository:
class Repository
{
public Repository(DbContext ctx)
{
}
}
then i have this bindings:
Bind<IRepository>().To<Repository>();
Bind<DbContext>().To<UserStoreContext>().When...
Bind<DbContext>().To<CentralStoreContext>().When...
and then i have class that needs to access both db's
class Foo
{
public Repository(IRepository userRepo, [CentralStoreAttribute]IRepository centralRepo)
{
}
}
How should i configure two DbContext
bindings so that repositories with right contexts (based on CentralStoreAttribute) would be injected into Foo constructor?