Hello everybody,
I do have the following class: public class MainView : IHandle<MessageOne>,
IHandle<MessageTwo>...
I would like to register all classes implementing at least one closed version of the IHandle<> Interface with the fluent registration of Castle Windsor but it does not work. BasedOn(typeof(IHandleThe<>)) is not selecting the right types. I use the following statement:
container.Register(AllTypes
.FromAssemblyNamed("MyAssembly")
//.If(t => t.Name.EndsWith("View")
.BasedOn(typeof(IHandleThe<>))
.Configure(registration => DoStuff())
.WithService.Base);
The above code does not get into the Configure call but when I comment the BasedOn line and uncomment the If line, then it works. The If is not too helpful, though. Does anybody have an idea what I am doing wrong.
Any ideas/help is appreciated
Best regards Gope