Skip to content
This repository

Fluent validation extension for ninject.web.mvc

branch: master
Octocat-spinner-32 lib Updated to FluentValidation 3.4.6 March 27, 2013
Octocat-spinner-32 nuget Updated to FluentValidation 3.4.6 March 27, 2013
Octocat-spinner-32 packages Updated to FluentValidation 3.4.6 March 27, 2013
Octocat-spinner-32 src Updated to FluentValidation 3.4.6 March 27, 2013
Octocat-spinner-32 tools Update NAnt config for Windows 8 March 20, 2014
Octocat-spinner-32 .gitignore Added assembly description for nuget December 28, 2011
Octocat-spinner-32 HowToBuild.txt Updated How to Build - Reference teamcity.bbv.ch instead of codebetter January 10, 2014
Octocat-spinner-32 Ninject.Web.Mvc.FluentValidation.build Updated Build Scripts to support pull request builds on TeamCity March 19, 2014
Octocat-spinner-32 Ninject.Web.Mvc.FluentValidation.sln Updated to FluentValidation 3.4.6 March 27, 2013
Octocat-spinner-32 Ninject.build Improved build scripts and cleaned the project files November 01, 2010
Octocat-spinner-32 Ninject.include Fixed build script that version is not changed during dependency vers… March 20, 2014
Octocat-spinner-32 README.markdown Update README.markdown August 04, 2012
Octocat-spinner-32 ReleaseNotes.txt Updated Version to 3.2.0 March 21, 2014
Octocat-spinner-32 UnzipDependencies.cmd Improved Build scripts to allow the creation of zip files with a spec… December 06, 2010
Octocat-spinner-32 build-alpha.cmd Updated to Nuget 1.6 and added support for prerelease packages December 23, 2011
Octocat-spinner-32 build-beta.cmd Updated to Nuget 1.6 and added support for prerelease packages December 23, 2011
Octocat-spinner-32 build-rc1.cmd Updated to Nuget 1.6 and added support for prerelease packages December 23, 2011
Octocat-spinner-32 build-release.cmd Updated to NuGet 1.3 May 03, 2011
Octocat-spinner-32 build.cmd Added build scripts October 21, 2010
README.markdown

FluentValidation Ninject integration

To use follow these steps:

  1. Wire up Asp.net MVC to use the NinjectValidatorFactory:
NinjectValidatorFactory ninjectValidatorFactory = new NinjectValidatorFactory(ninjectKernel);
ModelValidatorProviders.Providers.Add(new FluentValidationModelValidatorProvider(ninjectValidatorFactory));
DataAnnotationsModelValidatorProvider.AddImplicitRequiredAttributeForValueTypes = false;
  1. Add a module to your project that will bind all of your validators:
public class FluentValidatorModule : NinjectModule
{
    public override void Load()
    {
        AssemblyScanner.FindValidatorsInAssemblyContaining<UserValidator>()
            .ForEach(match => Bind(match.InterfaceType).To(match.ValidatorType));
    }
}
Something went wrong with that request. Please try again.