Skip to content
Fluent validation extension for ninject.web.mvc
Batchfile C#
Find file
Latest commit e911d3d Jul 25, 2015 @scott-xu scott-xu Merge pull request #8 from rexcfnghk/refactor
Refactor NinjectValidatorFactory
Failed to load latest commit information.
lib/Ninject Updated to FluentValidation 3.4.6 Mar 27, 2013
nuget Updated to FluentValidation 3.4.6 Mar 27, 2013
packages Updated to FluentValidation 3.4.6 Mar 27, 2013
src Refactor NinjectValidatorFactory Jul 23, 2015
tools Adapted scripts to mono 3.4 Sep 3, 2014
.gitignore Added assembly description for nuget Dec 28, 2011
HowToBuild.txt Updated How to Build - Reference teamcity.bbv.ch instead of codebetter Jan 10, 2014
Ninject.Web.Mvc.FluentValidation.build Adapted scripts to mono 3.4 Sep 3, 2014
Ninject.Web.Mvc.FluentValidation.sln
Ninject.build Improved build scripts and cleaned the project files Nov 1, 2010
Ninject.include Adapted scripts to mono 3.4 Sep 3, 2014
README.markdown Update README.markdown Aug 4, 2012
ReleaseNotes.txt Updated Version to 3.2.0 Mar 21, 2014
UnzipDependencies.cmd Improved Build scripts to allow the creation of zip files with a spec… Dec 6, 2010
build-alpha.cmd Updated to Nuget 1.6 and added support for prerelease packages Dec 23, 2011
build-beta.cmd Updated to Nuget 1.6 and added support for prerelease packages Dec 22, 2011
build-rc1.cmd Updated to Nuget 1.6 and added support for prerelease packages Dec 22, 2011
build-release.cmd Updated to NuGet 1.3 May 3, 2011
build.cmd Added build scripts Oct 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.