I am trying to work out how to auto register implementations of an generic abstract class or interface. Here are my classes:
public abstract class AbstractValidator<T> : IValidator<T>
{
public void Validate(T)
{
...
}
}
public class CustomerValidator:AbstractValidator<Customer>
{
...
}
I am trying the following:
_container = new WindsorContainer();
_container.Register(
AllTypes.FromAssemblyContaining<ValidationPatterns>()
.BasedOn<IValidator>()
.WithService.Base()
}));
IValidator<Customer> val = _container.Resolve<IValidator<Customer>>();
Any tips greatly appreciated.
Cheers