2

Peut-on combiner BindBase() avec BindAllInterfaces() à un Factory?Comment combiner BindBase() avec BindAllInterfaces()?

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

et

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

Répondre

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

Pouvons-nous ajouter aussi BindToSelf()? , si pour un type existe multi liaison pour un type -> bindtoself –