public TemplateValidationException(DbEntityValidationException e) { foreach (var eve in e.EntityValidationErrors) { foreach (var ve in eve.ValidationErrors) { ValidErrors.Add(ve.PropertyName, ve.ErrorMessage); } } }
public bool Validation(ValidationResult valid) { this.IsValid = valid.IsValid; if (!IsValid) { this.IsSucceeded = false; foreach (var error in valid.Errors) { ValidErrors.Add(new ValidationResponse { Name = error.PropertyName, Message = error.ErrorMessage }); } } return(IsValid); }