Castle Windsor: Using convention registration along with specific implementations

后端 未结 2 477
星月不相逢
星月不相逢 2021-01-05 22:51

Assume we have IFoo implemented by Foo and IBar implemented by FirstBar and SecondBar.

Using this convention registration:

container.Register(
    Al         


        
2条回答
  •  渐次进展
    2021-01-05 23:23

    Tighten your convention. It is obviously to wide.

    container.Register(
        AllTypes.FromThisAssembly()
            .Where(t => t.Namespace != "Acme.Tests")
            .WithService.DefaultInterface())
    

提交回复
热议问题