I'm new using FubuMvc, I recently Update to version 1.0 which doesn't have any documentation and it seems like there's a lot of breaking changes in the code, I'm trying to understand how the validation rules and validation in general works in fubu.
I can't find the validation method even If I import FubuMVC.Validation
this.Validation(x => {
x....
});
is there any new approach for this, I just would like to have clear the concept of how the validation occurs in fubu.
Can I apply a convention for validation? Example: to all my Entities that contain a field named "email" apply a regex validation with a standard formatting.
The new FubuMVC.Validation bottle is completely drop-in and doesn't require much configuration at all. If you want to configure the chains it applies to, simply do:
AlterSettings(x => ...); <--- in your FubuRegistry
Right now, we don't do conventional validation that way out-of-the-box. You have two ways:
Examples of both of those can be found here (respectively):
That being said...
Anything that implements IFieldValidationSource gets automatically registered into your container. This is how we convert from OverridesFor to rules, for example:
So you could reflect on that property and return an EmailFieldRule. Something like this:
https://gist.github.com/4540861
Hope this helps,
Josh