1
I Use This!
Activity Not Available

News

Posted about 11 years ago by Jeremy Skinner
Merge pull request #40 from ChrisLotter/patch-1 Update README.txt
Posted about 11 years ago by JeremyS
I can't reproduce the problem in any of my tests. If you could put together a small sample project that reproduces the problem and email it to me (at [email protected] ), then I can investigate further. Thanks. Jeremy
Posted about 11 years ago by JeremyS
Hi You can use the descriptor to get this information - call CreateDescriptor on the validator instance, which you can then use to get metadata about which validators are associated with which properties. Jeremy
Posted about 11 years ago by amarwadi
Hello, I have been using FluentValidation w/ Web API 2.0 and things work very well for me. Recently, we wanted to start exposing our Validation rules to consumers via an API call. Consumers would simply call a known path to obtain the validation ... [More] rules. This also helps a front-end interface dynamically query the API to obtain validation rules thereby preventing them from being duplicated on the API. So for e.g. say I have a Site class with properties Name and Abbreviation. Say I have a Required validation for both the properties and a WithMessage() as well. It would be awesome if I could get all validations that are applied to the Site object so that I could convert them into a string representation and eventually into a JSON object similar to the one shown below: { "entity" : "site", "validations" : [ { "element" : "name", "required" : "true", "message" : "Name is required" }, { "element" : "abbreviation", "required": "true", "message" : "Abbreviation is required" } ] } The above is just an example. Essentially, I think I would create an extension that splits out a string representation of the messages for each property and eventually I would use that to build the JSON. Does FluentValidation have any way I could get this data? Any guidance would help! [Less]
Posted about 11 years ago by frederikprijck
Is this supported in the current release?
Posted about 11 years ago by krama12345
Hi Jeremy I have a similar issue in MVC. Taking the above example it shows me that address and person object have been instantiated but they do not have any value. Can you please provide a work around as we are planning to go live in two weeks time, its extremely critical that I get the server side validation to work. thanks Kartik
Posted about 11 years ago by purekrome
Hi Jeremy, thanks heaps for accepting it. Ah! i didn't notice the tabs/spaces thing, but apologies for that. Will there be a new Nuget package coming out with this PR?
Posted about 11 years ago by Jeremy Skinner
Fix indentation etc from previous commit
Posted about 11 years ago by JeremyS
Thanks - I've merged it in. In future, it'd be great if you could match your commits with the existing code style (tabs instead of spaces etc). Thanks!
Posted about 11 years ago by JeremyS
Hi You could use a Custom validator for this (see the section on "AbstractValidator.Custom" on this page