Exemplo 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" })));
        }
Exemplo 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" })));
        }