2012-07-22 159 views
-2

我嘗試了兩天使用Ninject將值傳遞給類板構造函數的示例。我看過很多例子,但我不太瞭解。特別是我想看到的,以及錄製的建設(綁定)的配置,以及在運行時傳遞一個值:如何使用Ninject將參數傳遞給構造函數

 
    _Kernel.Get(of MyRoot)(Pass. "TheValue". At.param. "Param1". For(of INdependency)) 
+1

這是你在找什麼? http://stackoverflow.com/questions/2227548/creating-an-instance-using-ninject-with-additional-parameters-in-the-constructor – 2012-07-22 21:39:16

回答

2

您可以嘗試使用.WithConstructorArgument。

相關問題