title: FluentValidation Autofac ValidatorFactory
body: <p>I need to be able to provide the <code>IComponentContext</code> to my <code>ValidatorFactory</code> to resolve FluentValidation Validators. I am a little stuck.</p>
  
  <p>ValidatorFactory</p>
  
  <pre><code>    public class ValidatorFactory : ValidatorFactoryBase
      {
          private readonly IComponentContext context;
  
          public ValidatorFactory(IComponentContext context)
          {
              this.context = context;
          }
  
          public override IValidator CreateInstance(Type validatorType)
          {
              return context.Resolve(validatorType) as IValidator;
          }
      }
  </code></pre>
  
  <p>How do I provide the context and register the <code>ValidatorFactory</code></p>
  
  <pre><code>FluentValidation.Mvc.FluentValidationModelValidatorProvider.Configure(x =&gt; x.ValidatorFactory = new ValidatorFactory());
  </code></pre>