Dynamic validation stops after first failure

I already know (like well explained in this other question Using CascadeMode.StopOnFirstFailure on a validator level) that the cascade model of the Fluent Validation works only at Rule level and not at Validator level. I have a task like this: RuleFo

FluentValidation requests an IValidator & lt; string & gt;

We're using fluent validation in a web API. There are a couple of places where the endpoints accept view models which have a property of type string[]. I have a problem that whenever we use one of these endpoints, if the string array contains any ele

FluentValidation Rule for MVC DropDownListFor?

I am trying to validate dropdown list using FluentValidation. I think I am doing wrong, but not able to find to solution. I need your help. Model [FluentValidation.Attributes.Validator(typeof (MeetingAbstractValidator))] public class MeetingAbstract

only the min / max length should be validated

I use FluentValidation framework in my ASP.NET MVC 4 project for both server-side and client-side validation. Is there native (non-hack) way to validate string length with only max length, or only min length? For example this way: var isMinLengthOnly

Conditional Connection Validation Using Fluid Validation

I am trying to use Fluent Validation and it seems easy to use at the beginning but now there is some problem. I need to validate a SignIn view model, shown below: public SignInViewModelValidator(IMembershipService membershipService) { _membershipServ

Unit test wiring for MVC, FluentValidation and Ninject

I have set up an MVC web project with FluentValidation and Ninject using the Ninject.Extensions.Mvc.FluentValidation package. I followed the documentation of that package directly. I'd like to write an automated test that verifies this wiring, and ch

Dependency dependent validation in the Web API

In MVC, I can create a Model Validator which can take Dependencies. I normally use FluentValidation for this. This allows me to, for example, check on account registration that an e-mail address hasn't been used (NB: This is a simplified example!): p

How to use the 'When' method in ASP.NET MVC Fluent Validation?

I am trying to develop a fluent valiation rule where if my TitleId FK property is null, then the TitleOther text field becomes mandatory. I have tried several combinations and orders of fluent expressions, all to no avail. This is what I have so far,

FluentValidation several validators

Can I add more than one validator to an object? For example: public interface IFoo { int Id { get; set; } string Name { get; set; } } public interface IBar { string Stuff { get; set; } } public class FooValidator : AbstractValidator<IFoo> { public F

Current validation - MVC 3

I'm using fluent validation in MVC 3. Is it possible to turn off fluent validation for specific post action in controller? ThanksAssuming you are using the AttributedValidatorFactory and you wanted to disable validation for the Index action on Home c

Validate DateTime with FluentValidator

This is my ViewModel class: public class CreatePersonModel { public string Name { get; set; } public DateTime DateBirth { get; set; } public string Email { get; set; } } CreatePerson.cshtml @model ViewModels.CreatePersonModel @{ ViewBag.Title = "Crea

ASP.net MVC Validation Hook

I have the following view in ASP.net MVC 3: @model Models.CreateProjectViewModel <script type="text/javascript" src="@Url.Content("~/Scripts/jquery.validate.min.js")"></script> <script type="text/javascrip

Fluent Validation and Data Annotations

Which approach for ASP.NET MVC validatation do you prefer and why? Fluent Validation? Data annotations? Any other?I prefer Fluent Validation: It gives me far better control of my validation rules Doing conditional validation on different properties i

Pass the error message for client-side validation

Since there is no way to validate a property (with unobtrusive clientside validation) using multiple regex patterns (because validation type has to be unique) i decided to extend FluentValidation so i can do the following. RuleFor(x => x.Name).NotEmp

Custom validation attribute with multiple instance problem

I'm using tha namespace System.ComponentModel.DataAnnotations in C# 4 to implement my own validation attribute and it looks like this [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)] public sealed class MyCustomValidator : ValidationAtt

Best practices for validating entries in ASP.NET?

What is the common practice of input validation? In other words do you check for input validation on client-side, on server-side or on both sides? Also, if performance is crucial to me, would just the client-side input validation be sufficient for my

How to validate a string as a DateTime using FluentValidation

With FluentValidation, is it possible to validate a string as a parseable DateTime without having to specify a Custom() delegate? Ideally, I'd like to say something like the EmailAddress function, e.g.: RuleFor(s => s.EmailAddress).EmailAddress().Wit