0
當設置我的ninject綁定,我使用的是.ToMethod指定特定的ConnectionStrings特定參數和WhenInjectedInto方法來約束綁定到特定類型:可以使用InInjectedInto爲ninject指定多個參數嗎?
Bind(Of IDbConnection).ToMethod(Function(context) New OracleConnection(ConnectionStringFactory.GetConnection(DBC.ConnectionStrings.Oracle))).WhenInjectedInto(Of AccountBalancesLookup)()
Bind(Of IDbConnection).ToMethod(Function(context) New OracleConnection(ConnectionStringFactory.GetConnection(DBC.ConnectionStrings.Oracle))).WhenInjectedInto(Of MFUtility)()
我的問題是,我可以做像這樣:
Bind(Of IDbConnection).ToMethod(Function(context) New OracleConnection(ConnectionStringFactory.GetConnection(DBC.ConnectionStrings.Oracle))).WhenInjectedInto(Of AccountBalancesLookup, MFUtility)()
一次指定多個綁定目標,而不是多行?