Hats off. It is a great framework. I used it lot of time in my project. For my new project i have to pass error code and and customize all the error message.
For example i have to generate error code 1201 for NotEmpty validation with our own validation message.
I am wondering is there are a way i can pass the resource file to the framework. So the framework picks up my message instead of default message.
For example instead of
'{PropertyName}' must not be empty.
i will add
Error Code 1201. {Property} must be populated.
I really don't want to add WithMessage all the time.
Comments: Yep - you can specify your own ResourceProviderType: [https://fluentvalidation.codeplex.com/wikipage?title=Localization&referringTitle=Documentation](https://fluentvalidation.codeplex.com/wikipage?title=Localization&referringTitle=Documentation) The provider type should declare 1 property for each default resource name.
For example i have to generate error code 1201 for NotEmpty validation with our own validation message.
I am wondering is there are a way i can pass the resource file to the framework. So the framework picks up my message instead of default message.
For example instead of
'{PropertyName}' must not be empty.
i will add
Error Code 1201. {Property} must be populated.
I really don't want to add WithMessage all the time.
Comments: Yep - you can specify your own ResourceProviderType: [https://fluentvalidation.codeplex.com/wikipage?title=Localization&referringTitle=Documentation](https://fluentvalidation.codeplex.com/wikipage?title=Localization&referringTitle=Documentation) The provider type should declare 1 property for each default resource name.