I have two classes that inherit from the same base class.
public class UserDetailValidator : BaseValidator<UserDetail>{
public UserDetailValidator(IRepository<Person, Guid>
userRepository,
AddressValidator addressValidator)
{
RuleFor(x => x.FirstName).Length(1, 10);
}
}
public class AddressValidator : BaseValidator<Address>
When I try and get the UserDetailValidator from WindsorServiceLocator
I get the error
Missing dependency.
Component UserDetailValidator has a dependency on AddressValidator,
which could not be resolved.
Make sure the dependency is correctly registered in the container as a
service, or provided as inline argument. I'm using the following in
my ValidationInstaller.
container.Register(
AllTypes.FromAssemblyNamed("Validation")
.IncludeNonPublicTypes()
.BasedOn(typeof(IValidator<>))
.WithService.AllInterfaces()
.LifestyleTransient()
The IRepository component is being injected with no problems. It's
only the AddressValidator that does not come in. What am I not doing
properly?
--
You received this message because you are subscribed to the Google Groups
"Castle Project Development List" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/castle-project-devel?hl=en.