0
votes

Is there any possibility to automatically register all TypedFactories that implement a certain interface in castle windsor?

my interface looks like this:

Public Interface IViewModelFactory(Of TViewModel)

    Function Create() As TViewModel

    Sub Release(view As TViewModel)

End Interface

I try to register all my factories the following way:

container.Register(Classes _
                   .FromThisAssembly() _
                   .BasedOn(GetType(IViewModelFactory(Of ))) _
                   .WithServiceFromInterface() _
                   .Configure(Sub(o) o.AsFactory()))

but none of my factories is registered

Thanks

1

1 Answers

1
votes

use Types, not Classes, those aren't classes but interfaces.