New Post: Equivalent of [DataType(DataType.DateTime)]
FluentValidation is a server-side validation library. It performs no client-side validation at all. However, it does integrate with ASP.NET MVC's clientside validation infrastructure for certain basic...
View ArticleNew Post: compare fluent validation and EntLib Validation Application Block
Can anyone give comparison of fluent validation and EntLib Validation Application Block? what are advantages/disadvantages of each of them? What are scenarios when one or another should be used?
View ArticleNew Post: compare fluent validation and EntLib Validation Application Block
I've personally never used EntLib, so I can't write a comparison but if you have any specific questions about what FluentValidation can or can't do then feel free to ask. Jeremy
View ArticleNew Post: Entity Validation Result Extension
I'm thinking about using FluentValidation with entites, too. Could you provide more info on this? Where do you execute entity validation? How do you use adapter? Best regards dario-g
View ArticleNew Post: multiple validation on the same property with message
Hello, First awsome job on this framework, I'm trying to setup some rules on one propperty. I want it to be not null and one of two string values. For example: RuleFor(x => x.MyProperty).NotNull();...
View ArticleNew Post: multiple validation on the same property with message
> if the first rule fails, why it would still return the following rules as failed as well. if there a way to stop validation when the first rule fails? This is the default behaviour, but you can...
View ArticleNew Post: IValidator.Validate(null)
How can I add a rule that an object passed to .Validate(..) cannot be null? I currently have to do if(obj==null || !Validator.Validate(obj)) throw new Exception()) I want to include the obj==null...
View ArticleNew Post: IValidator.Validate(null)
Hi This isn't supported out of the box as it isn't the intended use for FluentValidation. FV works by validating the properties of an object, so assumes that you're passing in an object which is ready...
View ArticleNew Post: Removing a validator
I have an AddressValidator for an Address class, an RegistrationModel, which contains two instances of Address. Due to auto-wire-up, both addresses get validated the same way. Is there a way to remove...
View ArticleNew Post: Removing a validator
This is really down to your container configuration. You'll need to manually tell the container how to wire up this particular instance rather than relying on autowiring. How to do this depends on...
View ArticleNew Post: Removing a validator
Yes, I use the example you posted. Thanks for your help. I'll look into changing how it gets wired with StructureMap....
View ArticleNew Post: Removing a validator
I solved the issue by modifying this wire-up to exclude validators with a particular attribute. This was a little tricky since attributes apply to instances, not types. It is also not ideal, as I would...
View ArticleNew Post: Removing a validator
You don't need the call to Activator.CreateInstance in there - attributes do actually apply to types, not instances. This would be a better check: if(! Attribute.IsDefined(result.ValidatorType,...
View ArticleNew Post: Removing a validator
Thank you, Jeremy. That is useful to know. I thought types did not have attributes because while exploring the type in the watch window, the "Attributes" property did not have my attribute.
View ArticleNew Post: Loading validation rules from external file
Hi, Is it possible to load validation rules for the business object from an external file? I know it is possible in microsoft validation framework. Any suggestions are welcome Thanks, Rushi
View ArticleNew Post: Loading validation rules from external file
Hi This isn't something that's supported I'm afraid. The purpose of FluentValidation is to provide a way to build rules using C# in a strongly-typed way - having rules loaded from an external file...
View ArticleNew Post: Loading validation rules from external file
Hi Jeremy Thanks for your prompt reply. I guess I have to use entlib then. Cheers, Rushi
View ArticleNew Post: ASP.NET Web API
Great library. Are there any plans to add support for ASP.NET Web API?
View Article