Quantcast
Channel: Fluent Validation for .NET
Browsing all 1917 articles
Browse latest View live

New Post: Validating properties with separate validators

If I have a class like:   class Credentials { public string Login { get; protected set; } public string Password { get; protected set; } } and want to implement several validators for login, like,...

View Article


New Post: Validating properties with separate validators

Hi Your best bet is to write a custom property validator for this - take a look at this page on the docs for details: http://fluentvalidation.codeplex.com/wikipage?title=Custom Jeremy

View Article


New Post: Is it possible to associate an ID with a rule?

I have the need to validate a class based on multiple rules, and for each rule display an error message accordingly. Mutliple rules may be applied to same property. However, I do not want to hard code...

View Article

New Post: Is it possible to associate an ID with a rule?

You can use the WithState method to associate any arbitrary data with a rule, so you could use this to tag a rule with a key that you can use to look up your message.  Jeremy

View Article

New Post: Is it possible to associate an ID with a rule?

Exactly what I need, thanks.

View Article


Reviewed: 3.2 (Dec 07, 2011)

Rated 5 Stars (out of 5) - Great product - Thanks for your work!

View Article

Reviewed: 3.2 (Dec 11, 2011)

Rated 5 Stars (out of 5) - Excellent work!

View Article

New Post: Feature Request: Integrating with Catel MVVM via Validator Provider

Catel is a powerfull MVVM toolkit that provides a flexible approach to use external validation frameworks. Could you provide an implementation of a provider for a build-in FluentValidation integration...

View Article


New Post: MVC Integration and Unobstrusive Validation Support

Does anybody know that if I integrate with MVC, does the toolkit support unobstrusive validation? Or partially suport the functionality?

View Article


New Post: MVC Integration and Unobstrusive Validation Support

Yes it does, but only a very limited subset of validators can be translated to client-side rules. These are: *NotNull/NotEmpty*Matches (regex)*InclusiveBetween (range)*CreditCard*Email*EqualTo...

View Article

New Post: Feature Request: Integrating with Catel MVVM via Validator Provider

Hi I don't actually include integration with any 3rd party frameworks directly inside FluentValidation (the only exception being ASP.NET MVC), due to the maintenance overhead this requires (and in this...

View Article

New Post: Get index in a collection as nested property

Total fictional example: we have an object hiearchy like this: School -> Faculty -> Professors, where Professors is a collection of Professor.  School also has a property called Budget. We have...

View Article

New Post: Get index in a collection as nested property

If you're using a collection validator (using SetCollectionValidator) then the index is automatically included in the property name. However, if you need to perform the validation at the school level...

View Article


New Post: Get index in a collection as nested property

Is any example available using the Adaptor? Here we have School/Faculty/Professor (Professors is just a list of Professor).  I assume that I will inherit the Adaptor and apply it to the Professor...

View Article

New Post: Get index in a collection as nested property

Unfortunately you can't actually inherit from the adaptor - the way it's currently designed means that you need to re-implement most of the logic (something I'm going to investigating changing in a...

View Article


New Post: Get index in a collection as nested property

"Unfortunately you can't actually inherit from the adaptor", I have come to realize that. After reading all relateds posts I can find online, I have started to inherit from NoopPropertyValidator and...

View Article

New Post: SetValidator not working

Hi, I have a UserValidator as follows:   public class UserValidator : AbstractValidator<Entities.User> { public UserValidator() { RuleFor(user => user.Culture).SetValidator(new...

View Article


New Post: SetValidator not working

SetValidator is designed to be used with non-null complex properties - any validator configured with SetValidator will be skipped if the property is null. In the case where having a null value is not...

View Article

New Post: SetValidator not working

Thank you for the very fast answer! As you said, I used the extension method and it worked, but I also had to test for null:   public static IRuleBuilderOptions<T, string>...

View Article

New Post: SetValidator not working

Ah yes, my mistake - both validators will be executed by default, although this can be overridden by changing the CascadeMode. Jeremy

View Article
Browsing all 1917 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>