Why doesn't Nancy automatically register DefaultFluentAdapter for IFluentAdapterFactory?

It is more "Why should I?" than the actual problem.

I decided to integrate FluentValidation as stated in the NancyFX docs

NancyFX FluentValidation Integration

The documents indicate that nothing more needs to be done. So I installed the package from NuGet as

Install-Package Nancy.Validation.FluentValidation -Version 1.4.1

And then update the root validator that references Nancy.Validation.Fluentvalidation

https://www.nuget.org/packages/FluentValidation/

I created a simple validator very similar to the docs to check it out.

And when you run this sentence in NancyModule

this.Validate(user);

I get an error

An exception of type 'Nancy.Validation.ModelValidationException

No model validator factory could be located. Please ensure that you have an appropriate validation package installed

... , , , , factory , , (TinyIoC) IFluentAdapterFactory, , , . , factory, , thats DefaultFluentAdapterFactory

, .

container.Register(typeof (IFluentAdapterFactory), typeof (DefaultFluentAdapterFactory));

? - , ? ?

!

+4

All Articles