Hello,

Is there a way to use both validation attributes and external
attributes mappings with the Validator library? That is, on some
classes I want to use attributes to define the validation rules, but
on others I want to use a validation mapping class.

I'm currently configuring the validator using:

    var validatorConfiguration = new FluentConfiguration();
    validatorConfiguration
        .Register<TimePeriodValidation, TimePeriod>()
        .SetDefaultValidatorMode(ValidatorMode.UseExternal)
        //.SetDefaultValidatorMode(ValidatorMode.UseAttribute)
        ;

    var validator = new ValidatorEngine();
    validator.Configure(validatorConfiguration);

    var errors0 = validator.Validate(new TimePeriod { StartDate = new
DateTime(2000, 1, 1), EndDate = new DateTime(2010, 1, 1)});
    var errors1 = validator.Validate(new TimePeriod { StartDate = new
DateTime(2010, 1, 1), EndDate = new DateTime(2000, 1, 1) });

Using the SetDefaultValidatorMode(ValidatorMode.UseExternal) works
fine. But with ValidatorMode.UseAttribute it does not...

Can this be done? I'm doing something wrong?

TIA!

Best regards,
Rui Lopes

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to