Esempio n. 1
0
        public IEnumerable <ValidationResult> Validate(System.ComponentModel.DataAnnotations.ValidationContext validationContext)
        {
            var validator = new ProductValidator();
            var result    = validator.Validate(this);

            return(result.Errors.Select(error => new ValidationResult(error.ErrorMessage, new [] { "errorMessage" })));
        }
Esempio n. 2
0
        public IEnumerable <ValidationResult> Validate(ValidationContext validationContext)
        {
            var validator = new ProductValidator();
            var result    = validator.Validate(this);

            return(result.Errors.Select(error => new ValidationResult(error.ErrorMessage, new [] { "errorMessage" })));
        }