1
目的は次のようにカーネルを設定するときに、同じコンストラクタ引数を複数回宣言することを避けるためにです:NInject:複数のバインディング間でコンストラクタ宣言を共有
Kernel.Bind<ISomeService>().To<SomeService>();
Kernel.Bind<SomeService>().ToSelf().WithConstructorArgument("arg", "value");
:で試してみました
Kernel.Bind<ISomeService>().To<SomeService>()
.WithConstructorArgument("arg", "value");
Kernel.Bind<SomeService>.ToSelf()
.WithConstructorArgument("arg", "value");
"バインドチェーン"が考慮されることを望んでいますが、そうではありません。
あなたはこの質問を見ることができると思いますか? http://stackoverflow.com/questions/40198294/how-to-configure-ninject-so-that-it-creates-a-single-instance-per-controller?noredirect=1#comment67673663_40198294 – eddy