using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace common { public class ValidationError { public ValidationError() { } public string ErrorMessage { get; set; } } public class ValidationErrors : List { /// /// 添加错误 /// /// 信息描述 public void Add(string errorMessage) { base.Add(new ValidationError { ErrorMessage = errorMessage }); } /// /// 获取错误集合 /// public string Error { get { string error = ""; this.All(a => { error += a.ErrorMessage; return true; }); return error; } } } }