Skip to content

ValidationFailure

Implementation of IValidationFailure describing one field-level validation error: which property failed, the attempted value, and the message to surface.

Purpose

  • Implementation of IValidationFailure describing one field-level validation error: which property failed, the attempted value, and the message to surface.

Context

  • Namespace: SAIF.Common
  • Assembly/package: SAIF.Framework.Common

Public members

Member Signature Purpose
AttemptedValue public object AttemptedValue { get; set; } The value that failed validation.
ErrorMessage public string ErrorMessage { get; set; } Human-readable description of the failure.
PropertyName public string PropertyName { get; set; } The name of the property/field that failed.
ValidationFailure() public ValidationFailure() Parameterless constructor for property-initializer style construction.
ValidationFailure(string propertyName, string errorMessage, object attemptedValue) public ValidationFailure(string propertyName, string errorMessage, object attemptedValue) Constructs a fully-populated failure in one call.

Sources

  • Common/SAIF.Common/Classes/ValidationFailure.cs