Example #1
0
 public ValidationError(Type validationType, string message, FieldInstanceData data)
 {
     ValidationType = validationType;
     _message       = message;
     Stack          = data != null ? data.Stack : new List <object>();
     _objectName    = GetObjectsName(data?.Obj);
     _fieldName     = data?.FieldInfo != null ? $"{data.FieldInfo.DeclaringType}.{data.FieldInfo.Name}" : null;
 }
Example #2
0
 public void Add(Type validationType, string message, FieldInstanceData data = null)
 {
     var error = new ValidationError(validationType, message, data);
     ValidationErrors.Add(error);
 }