Hi all, I'm looking for advice on how best to bind a couple of connection strings which recur throughout my dependencies in ninject.
Currently I have:
Bind<IFoo>().To<SqlFoo>()
.WithConstructorArgument("db1ConStr", db1ConnectionString)
.WithConstructorArgument("db2ConStr",
db2ConnectionString);
Bind<IBar>().To<SqlBar>()
.WithConstructorArgument("db1ConStr", db1ConnectionString)
.WithConstructorArgument("db2ConStr", db2ConnectionString)
etc.
which obviously is not the most elegant code.
What the idiomatic way with ninject to bind the value of db1ConnectionString to every constructor parameter named "db1ConStr"?