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

New Post: Calling stored procedure with output parameter from a Rule

Simplest thing to do would be to use a method group:public class MyValidator : AbstractValidator<Category> { public MyValidator(){ RuleFor(x=>x.Description).Must(BeUniqueDescription); }...

View Article


New Post: Bug with {PropertyName} ?, adding spaces between the variable

Hi! First - love the framework, the functionality provided and what it can do is outstanding. But - I second this, the wish for an option controlling how this behaves (on global level, or on...

View Article


New Post: Bug with {PropertyName} ?, adding spaces between the variable

You can change this globally by setting the static property ValidatorOptions.DisplayNameResolver

View Article

New Post: Nuget FluentValidation.MVC4 incompatible with FV 5.3.0.0

Thanks for clarifying! I completely understand why you'd not want to maintain old versions. We're currently stuck on .net 4.0, as our servers are win2k3. We are currently planning our server upgrades,...

View Article

New Post: RuleFor Object

Hi, I've to validate de following quite complex scenery (at least for me :D). Let's say: public class CLASSA { public ItemSelectorEnum ItemSelector {get; set; } public object Item {get; set;} } public...

View Article


New Post: RuleFor Object

Replying to myself, in order someone there is in same situation The key is to cast object to right type. public class ClassAValidator : AbstractValidator<ClassA> { public ClassAValidator() {...

View Article

New Post: Handling inheritance

I needed something similiar for one-to-one properties that could be of several subclass types so I adapted your PolymorphicCollectionValidator to a PolymorphicValidator and it seems to be working...

View Article

New Post: Possible to use same model validate two times?

We are trying to do a similar thing. We don't want certain validators to fire when all we need is an ID. We are using the MVC Integration and it sees both validators, even if we explicitly call...

View Article


New Post: Possible to use same model validate two times?

MVC integration only invokes validators that are wired up with the ValidatorAttribute. If you only want to use SetValidator, then remove any ValidatorAttributes you have applied to your child model.

View Article


New Post: Possible to use same model validate two times?

I don't think we have any ValidatorAttributes on the child model. I'll double check. We are wiring up Fluent Validation with StructureMap though. Not sure if that would make any difference.

View Article

New Post: Possible to use same model validate two times?

Yes, that would make a difference - you'd need to ensure you don't register the child validator with structuremap if you don't want it to be invoked automatically (or change your validator factory...

View Article

Source code checked in, #99797e76ea7a327f8a2c561dd4a26fc8dbf450fb

Merge pull request #35 from nevaenuf/display-name-performance Performance improvement with PropertyName.SplitPascalCase

View Article

Source code checked in, #e4f4fe09536de16d3fe560d3ba760aecced5ff16

Merge pull request #36 from nevaenuf/display-name-bug-in-mvc fix issue introduced in display-name-performance branch

View Article


Source code checked in, #de2d1b139d0155411cd21bb4248c6427c319d4ab

Fix inconsistent code style from latest merge

View Article

New Post: How to pass in RuleSet in call to SetValidator

I would like to chain validation of complex property as such: RuleFor(x=> x.Address).SetValidator(new Address.Validator(), ruleSet: "ZipCode") This would be much more succinct then creating the...

View Article


New Post: Help with Credit Card Expiry Date Validation

Hi, I'm new to Fluent Validation. I know I should be able to do this, and have looked up lots of other posts but just can't figure it out. ExpireMonth and ExpireYear are strings This bit works fine...

View Article

New Post: Help with Credit Card Expiry Date Validation

Hi A call to RuleFor should reference a property directly. You can't call Convert.ToInt32 from within a rule definition. You'll either need to 1) change the data type of your ExpireMonth and ExpireYear...

View Article


New Post: How can I access controller TempData ...

Hello Is it possible to access controller TempData in a Validator ? Thanks

View Article

New Post: Help with Credit Card Expiry Date Validation

Thanks Jeremy, think I finally figured it out, making sure it only runs if fields are not empty/null RuleFor(x => x.ExpireYear).Must(x => Convert.ToInt32(x) >= DateTime.Now.Year).When(f =>...

View Article

New Post: How can I access controller TempData ...

Hi No. Validators are completely separate from mvc, and have no knowledge of any mvc-specific items such as controllers or tempdata. The only thing that the validator sees is the object being passed to...

View Article
Browsing all 1917 articles
Browse latest View live


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