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

New Post: Validate a List of objects

You can't really do that. If you want the result to look like it's been run against just 1 item, then you'll need to run it against just 1 item. Simplest way would be to encapsulate your list as a...

View Article


New Post: Validate a List of objects

So, haven't tested this yet, but, theoretically, something like this should work and look similar to what you would get if you made a wrapper class:public static ValidationResult Validate<T>(this...

View Article


New Post: Validate a List of objects

This isn't going to work because IValidate<T>.Validate takes in an object, so that will always take precedence over the extension method.

View Article

New Post: Validate a List of objects

You could rename it - ValidateCollection maybe?

View Article

New Post: Validate a List of objects

I think you're right. Looks like this works:public static ValidationResult ValidateCollection<T>(this IValidator<T> validator, IEnumerable<T> instances) { ValidationResult result =...

View Article


Commented Unassigned: Better Email Regex [7150]

Hi Jeremy,We have had some issues with the FV Email regex, but every time we do it makes it through the client side validation first from jquery validation which uses this regex.Could this be changed...

View Article

Commented Unassigned: Better Email Regex [7150]

Hi Jeremy,We have had some issues with the FV Email regex, but every time we do it makes it through the client side validation first from jquery validation which uses this regex.Could this be changed...

View Article

Closed Unassigned: Better Email Regex [7150]

Hi Jeremy,We have had some issues with the FV Email regex, but every time we do it makes it through the client side validation first from jquery validation which uses this regex.Could this be changed...

View Article


Source code checked in, #4b12a6a6d5d9511a899b5727e491ab28e0f95195

Fix issue #7150 - better email regex

View Article


New Post: Chaining validators with "Or" syntax

Hi, I have a Expiry Date property the can have either Date or Relative Expiration Date.In case of Date the format should be "dd-MMM-yyyy". In case of Relative Expiration Date the format should be, for...

View Article

New Post: Chaining validators with "Or" syntax

Well I think that I have found a way to do it:public static IRuleBuilderOptions<T, TProperty> Or<T, TProperty>(this IRuleBuilderOptions<T, TProperty> rule, IPropertyValidator...

View Article

Created Unassigned: FluentValidation MVC 5 support [7153]

Just tried upgrading one of my projects to MVC 5 RC1 and FluentValidation is throwing an exception FluentValidationModelValidatorProvider.Configure(); line in my Global.asax App_Start method. I don't...

View Article

Commented Unassigned: FluentValidation MVC 5 support [7153]

Just tried upgrading one of my projects to MVC 5 RC1 and FluentValidation is throwing an exception FluentValidationModelValidatorProvider.Configure(); line in my Global.asax App_Start method. I don't...

View Article


New Post: Custom Arguments on Client Side

I am having some trouble with custom arguments in a complex type. When it runs on the client side instead of the argument being inserted correctly I get "ID Number is required for true" instead of "ID...

View Article

New Post: Validation rules for Required fields

I'd love for it to be possible to have a conditional When expression IsValidSoFar and/or a DependsOn builder so I could do things like:RuleFor(x => x.ValidatableProperty,...

View Article


New Post: RuleSet is applied to chained validators

Hello, I am using the rule set in all the validators and I am calling the main validator with the ruleset name. But it doesn't call the child validators using the ruleset name. For ex,...

View Article

New Post: Custom Arguments on Client Side

Hi Custom placeholders in messages are a feature of FluentValidation's server-side validation. MVC's client-side validation does not support this. Jeremy

View Article


Created Unassigned: .WhenIsValid chainable [7154]

From https://fluentvalidation.codeplex.com/discussions/431262 and https://twitter.com/petemounce/status/372688617723801600, I'd like to be able to do:```RuleFor(x =>...

View Article

Created Unassigned: .WhenRulePasses chainable [7155]

I'd like to be able to do:```RuleFor(x => x.Tenant, "Basic").NotNull().NotEmpty();RuleFor(x => x.Tenant, "Semantic").SetValidator(new TenantValidator());RuleFor(x => x.Foo).SetValidator(new...

View Article

Commented Issue: Doesn't hook up to MVC ApiControllers [7116]

Hi, I'm trying to use fluent validation for my MVC 4 WebApi project.But it only seems to work on controllers that are inherited from the Controller type.When I use MyController : Controller -> works...

View Article
Browsing all 1917 articles
Browse latest View live


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