public static ErrorInfo AddInfo(this List<ErrorInfo> list, string message, string identifier = null,
     Action autoFix = null)
 {
     var error = new ErrorInfo()
     {
         Message = message,
         Identifier = identifier,
         AutoFix = autoFix,
         Siverity = ValidatorType.Info
     };
     list.Add(error);
     return error;
 }
 public static ErrorInfo AddError(this List<ErrorInfo> list, string message, IDataRecord record,
     Action autoFix = null)
 {
     var error = new ErrorInfo()
     {
         Message = message,
         Record = record,
         Identifier = record.Identifier,
         AutoFix = autoFix,
         Siverity = ValidatorType.Error
     };
     if (!list.Any(p => p.Equals(error)))
         list.Add(error);
     return error;
 }
Ejemplo n.º 3
0
 protected bool Equals(ErrorInfo other)
 {
     return string.Equals(Identifier, other.Identifier) && string.Equals(Message, other.Message);
 }