Hi Miguel,
I can't see anything obviously wrong there.
One thing you could try: cut and paste the methods from ValidatorFactoryBase into your class (not many there...) and make your class directly implement IValidatorFactory
https://fluentvalidation.codeplex.com/SourceControl/latest#src/FluentValidation/ValidatorFactoryBase.cs
Code below not tested at all!
I can't see anything obviously wrong there.
One thing you could try: cut and paste the methods from ValidatorFactoryBase into your class (not many there...) and make your class directly implement IValidatorFactory
https://fluentvalidation.codeplex.com/SourceControl/latest#src/FluentValidation/ValidatorFactoryBase.cs
Code below not tested at all!
public class IocValidatorFactory : FluentValidation.IValidatorFactory {
public IValidator CreateInstance(Type type) {
return ObjectFactory.Container.TryGetInstance(type) as IValidator;
} // CreateInstance
public IValidator<T> GetValidator<T>() {
return (IValidator<T>)GetValidator(typeof(T));
}
public IValidator GetValidator(Type type) {
var genericType = typeof(IValidator<>).MakeGenericType(type);
return CreateInstance(genericType);
}
} // IocValidatorFactory