是否有可能自动注册所有在castle windsor中实现特定接口的TypedFactory?
我的界面是这样的:
Public Interface IViewModelFactory(Of TViewModel)
Function Create() As TViewModel
Sub Release(view As TViewModel)
End Interface
我尝试以以下方式注册我的所有工厂:
container.Register(Classes _
.FromThisAssembly() _
.BasedOn(GetType(IViewModelFactory(Of ))) _
.WithServiceFromInterface() _
.Configure(Sub(o) o.AsFactory()))
但我的工厂都没有注册
感谢
使用Types
,而不是Classes
,它们不是类,而是接口。