seesharper/LightInject — pull request #92 by aaronmell (2014-07-09 15:00:15+00:00)
Title: Added a custom model validator

I created a custom model validator for mvc. Below is the code that is required in Globacl.Asax.cs. Not sure if you would find this pull request useful and want to accept it, or if its something you would rather not be a part of the project. Below is the code required to setup the validator in MVC

DataAnnotationsModelValidatorProvider.RegisterDefaultAdapterFactory((metadata, context, attribute) =>
{
var instance = new LightInjectModelValidator(metadata, context, attribute)
{
ServiceContainer = _serviceContainer.Value
};
return instance;
});