New Post: NullReferenceException using FluentValidation in MVC3
Yes, please send me the repro in a sample project. Jeremy@jeremyskinner.co.uk Thanks.
View ArticleNew Post: Dependent Validations
How can I define a Rule for the following scenario: The customer has a property - customerType, and according to that, there must be a validation to check if the home country he picked is in a lista...
View ArticleNew Post: Using FluentValidation in WPF application?
Hello. Is this library works with WPF applications? if yes do you have any article about implementing it? I'm using WPF and EF Code First. thanks.
View ArticleNew Post: Using FluentValidation in WPF application?
Hi Yes, FluentValidation will work fine in a WPF application - it's designed for validating objects and is not tied to any particular UI platform. I don't have any articles for using it with WPF I'm...
View ArticleNew Post: Dependent Validations
Hi Your method declaration doesn't look quite right. There are two overloads for Must - one accepts the property value, the other accepts the instance being validated and the property value. In your...
View ArticleNew Post: Dependent Validations
Thank you very much jeremy's. That was it! :) Going to search now, if it is possible to have the rules in xml files ;) Best regards.
View ArticleNew Post: Testing an "InEnumValidator" custom validator
I created a custom validator, which tests that an enum is valid, that means it is within the enum's range of valid values: [DebuggerStepThrough] public class IsInEnumValidator<T> :...
View ArticleNew Post: Testing an "InEnumValidator" custom validator
Would be cool if this method could be in the library itself
View ArticleNew Post: Find duplicate items in Collection
Hi I am new to fluent validation and facing the problem to find the duplicate item in the collection. I am using MVP. I just wanted to validate the user code in the UserPersonalCollection before...
View ArticleNew Post: Validating enums with a custom FluentValidator validator
Hi I'm not entirely sure I understand the purpose of your custom validator. If you're validating a property whose value is of type DayOfWeek, then by its very definition it will already be within the...
View ArticleNew Post: Find duplicate items in Collection
Hi FluentValidation is designed to validate the values of properties that have already been set on a particular object. In this case, you're validating the View, so checking whether the user is already...
View ArticleNew Post: Validating enums with a custom FluentValidator validator
The reason for the custom validator is that you can cast any int to an enum: enum DaysOfWeek { Mon=0, Tue, Wed, Thu, Fri, Sat, Sun } DaysOfWeek thisisallowed = (DaysOfWeek)100; DaysOfWeek...
View ArticleNew Post: Validating enums with a custom FluentValidator validator
Ah, I see what you mean. Because of type inference, you shouldn't have to specify either of the generics - you should just be able to say RuleFor(x => x.Property).IsInEnum() and the type inference...
View ArticleNew Post: Validating enums with a custom FluentValidator validator
So obvious! Anyways I changed the validator so it also works for nullable enums: protected override bool IsValid(PropertyValidatorContext context) { Type t = typeof(T).IsGenericType ?...
View ArticleNew Post: Find duplicate items in Collection
Hi, Thanks for the update. I have implemented the IUserView on the form. public partial class FrmUserRegistration : Form, IUserView { UserPresenter Presenter; public...
View ArticleNew Post: Can not find SetCollectionValidator Extention Method
Hi It's an extension method, so make sure you have the FluentValidation namespace imported. Jeremy
View ArticleNew Post: NullReferenceException using FluentValidation in MVC3
It has been almost two weeks since I sent a sample project and I have not heard from anyone regarding this issue. Are you able to reproduce the problem using the project I sent? If so, is this a...
View ArticleNew Post: NullReferenceException using FluentValidation in MVC3
HiI never received the sample project. If you could send it again, I'll take a look at it when I get some time, although I can't promise when this will be.Jeremy
View ArticleCreated Issue: Validation rules are not triggered on entering data [7117]
Hello,this is my code I have setup:public class ReleaseViewModelValidator : AbstractValidator<ReleaseViewModel>{ public ReleaseViewModelValidator(){ RuleFor(r => r.Name).NotEmpty().Length(1,...
View ArticleEdited Issue: Validation rules are not triggered [7117]
Hello,this is my code I have setup:public class ReleaseViewModelValidator : AbstractValidator<ReleaseViewModel>{ public ReleaseViewModelValidator(){ RuleFor(r => r.Name).NotEmpty().Length(1,...
View Article