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

Updated Wiki: Customising

Overriding the Default Error You can override the default error message for a validator by calling the WithMessage method on a validator definition: RuleFor(customer =>...

View Article


New Post: Documentation: DisplayNameAttribute

I accidentally discovered this trying to create a PropertyNameResolver, but FluentValidation already check for System.ComponentModel.DisplayNameAttribute in properties and use that in error messages....

View Article


Updated Wiki: Customising

Overriding the Default Error You can override the default error message for a validator by calling the WithMessage method on a validator definition: RuleFor(customer =>...

View Article

New Post: Documentation: DisplayNameAttribute

I've added this to the docs. Thanks for the suggestion.

View Article

Updated Wiki: Customising

Overriding the Default Error You can override the default error message for a validator by calling the WithMessage method on a validator definition: RuleFor(customer =>...

View Article


Updated Wiki: Customising

Overriding the Default Error You can override the default error message for a validator by calling the WithMessage method on a validator definition: RuleFor(customer =>...

View Article

Image may be NSFW.
Clik here to view.

New Post: Count invalid items in a model

Simple validation, loops over all the boxes and makes sure you enter something into at least one of them. RuleFor(model => model.AnyInvoicesEntered) .NotEmpty() .When(AtLeastOneValueEntered)...

View Article

New Post: Validating Object Graphs

I see how you can re-use a validator for Complex Properties and Collections, but how will it work when the reference is bi-directional? Will the example below produce an infinite loop, and if so what...

View Article


New Post: Idea for integration

You could probably use T4 templates to generate your validation classes. Look at the Reverse Engineer Code First in Entity Framework Power Tools. It gives you the option to generate your model,...

View Article


New Post: Validating Object Graphs

Update: I just tried this and got a StackOverflow exception like I expected. Is there a feature/setting that I'm missing that makes this work? Maybe by using the When method? It seems like a person...

View Article

New Post: Validating Object Graphs

Hi Yes, this will indeed cause a stackoverflow. Your best bet is either to remove one of the calls to SetValidator, and perform the validation manually when necessary or put one of the SetValidator...

View Article

New Post: Count invalid items in a model

Hi This message isn't coming from FluentValidation, but rather from MVC itself. Before ASP.NET MVC invokes validation, it will first check to see if the property can be set to the value. If it can't,...

View Article

New Post: Validating Object Graphs

It appears the StackOverflow is happening in the constructor while wiring up the validators instead of in the validators themselves. Is it possible to mark an entity as validated so it doesn't wire up...

View Article


New Post: Reuse rule set validator

Did you figure out if this worked?

View Article

New Post: Passing an object while validating

Hi Jeremy, Thanks for this wonderful library. I have been using it extensively for my project. I have a query which I have been not able to resolve. I have a requirement, where I am editing an object...

View Article


New Post: Validation Rule for overall model

I just ran into a need for this as well. I'm trying to perform validation that determines if a record has been entered twice. It needs to checks if three properties match the same three properties of...

View Article

New Post: Passing an object while validating

Hi Amit FluentValidation isn't really designed to work this way - all the context should be driven by properties on the object you're validating, not by passing in anything extra. The best way to do...

View Article


New Post: Validating Object Graphs

Hmm yes, so this does happen in the validator's constructor, not actually at the time of validation, so marking the entity itself as already validated won't actually help. Essentially your validator...

View Article

New Post: Validation of object hierarchy

I have this object hierarchy: Tab -> LayoutContainer -> PropertyField where LayoutContainer and PropertyField is abstract classes. I would like to create validator's for LayoutContainer and...

View Article

New Post: Non-property oriented validation

I have a requirement to make a validation that is not connected with any particular property but depends for example... on the state of the whole application/object etc. Is FluentValidation supplying...

View Article
Browsing all 1917 articles
Browse latest View live


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