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

New Post: Parent validation based on child collection

Hi This isn't something that FluentValidation supports. FluentValidation associates error messages against properties, so if a property in one of the children has caused validation to fail, then this...

View Article


New Post: Parent validation based on child collection

Thank for your reply. You comment makes sense. As work around I extended PropertyValidator to create custom class with logic to verify child list and used same with SetValidator for child collection.

View Article


New Post: SetCollectionValidator Client side validation

Hi, Does SetCollectionValidator supports Client side validation? I've read a post from 2011 that says that it doesn't. Tnks

View Article

New Post: MVC 4 Integration

Jeremy, Are you waiting for Microsoft to facilitate an easier path for code sharing between MVC and Api or is WebApi support as it is still a possibility?

View Article

New Post: MVC 4 Integration

Hi This is not something I'm planning on doing myself as I do not use webapi and as I mentioned above I am not happy with the poor design choices in MVC/webapi. Personally I'd rather keep webapi...

View Article


New Post: SetCollectionValidator Client side validation

Hi SetCollectionValidator is serverside only. Jeremy

View Article

Created Unassigned: A class inherited from DisplayNameAttribute is not used...

I have inherited a class from System.ComponentModel.DisplayNameAttribute. When I add the attribute for property, the property's attribute is not used by FV. I see from the source code that it uses...

View Article

Commented Unassigned: A class inherited from DisplayNameAttribute is not used...

I have inherited a class from System.ComponentModel.DisplayNameAttribute. When I add the attribute for property, the property's attribute is not used by FV. I see from the source code that it uses...

View Article


Commented Unassigned: A class inherited from DisplayNameAttribute is not used...

I have inherited a class from System.ComponentModel.DisplayNameAttribute. When I add the attribute for property, the property's attribute is not used by FV. I see from the source code that it uses...

View Article


New Post: Displaying an indication of a required field

I'd like to have an indication in my user interface when a field will be required (NotNull or NotEmpty) when validated. I'm using FluentValidationModelValidatorProvider and MVC3. I'm already extending...

View Article

New Post: Validation Rule for overall model

I'd like it as well. Proposed syntax looks good.

View Article

New Post: How to use WithMessage() with a dynamic text

In our MVC4 project we have a PhoneNumberModel, this model is beeing filled with content text from a database. On the contentmodel of this model we added two properties for showing validationmessages...

View Article

New Post: Providing a category with each validator

Hi, I'm using FluentValidation from within my domain and application layer. But I don't find a way to know from which layer a ValidationException was raised. For example, I would like to specify a...

View Article


New Post: Providing a category with each validator

Hi You can use the WithState method to associate a custom object with the failure, so you could use this to associate a category with the message: RuleFor(x => x.Surname).NotNull().WithState(x =>...

View Article

New Post: Providing a category with each validator

This is great, I will try this. Thank you for the answer!!

View Article


New Post: Validate a List of objects

Let's say I have an object, MyEntity, and a Validator for it, MyEntityValidator : AbstractValidator<MyEntity>. Now, I have incoming a List<MyEntity>, and I want to validate all the...

View Article

New Post: Validate a List of objects

Hi The typical way to do this would be to just use the MyEntityValidator by looping over the list and calling the Validate method for each item in the list in turn. Jeremy

View Article


New Post: Validate a List of objects

Thanks, JeremyS. Would you create a List<ValidationResult>, then? What if you want to throw an exception - is there a way to put all these together?

View Article

New Post: Validate a List of objects

Really depends on what you want to do...you have complete control of the code doing the iteration, so you can throw an exception if you encounter an error or just collect the ValidationResult instances...

View Article

New Post: Validate a List of objects

Jeremy - I'd like the result to look the same as if I'd done the validation on just one item, so that it's consistent. I just don't know how to approach that. Any thoughts? Edit: Essentially, my worry...

View Article
Browsing all 1917 articles
Browse latest View live