MrDave1999 / SimpleResults

A simple library to implement the Result pattern for returning from services
https://mrdave1999.github.io/SimpleResults
MIT License
105 stars 2 forks source link

Change error message format when validation fails from Fluent Validation #52

Closed MrDave1999 closed 11 months ago

MrDave1999 commented 11 months ago

Currently the SRFluentValidationResultExtensions.AsErrors method will return an error message like this:

'Name' must not be empty.
'First Name' must not be empty.

It would be good to change it to a more specific format like this one:

'Name' property failed validation. Error was: 'Name' must not be empty.

The template would look like this in English:

'{0}' property failed validation. Error was: {1}

And in Spanish:

Propiedad '{0}' falló en la validación. El error fue: {1}