2

BindBase()とBindAllInterfaces()をいくつかのFactoryに組み合わせることはできますか?BindBase()とBindAllInterfaces()を結合する方法は?

kernel.Bind(x => 
    { 
     x.FromThisAssembly() 
     .SelectAllClasses() 
     .WithAttribute<SomeAttribute>() 
     .BindBase(); 
    }); 

kernel.Bind(x => 
     { 
      x.FromThisAssembly() 
      .SelectAllClasses() 
      .WithAttribute<SomeAttribute>() 
      .BindAllInterfaces(); 
     }); 

答えて

0
.BindSelection((t, baseTypes) => 
    baseTypes.Where(bt => bt.IsInterface || bt == t.BaseType)) 
+0

我々はまたBindToSelfを()を追加することはできますか? 1つのタイプに対して複数のバインディングが存在する場合 - > bindtoself –

関連する問題