Skip to content

SaifValidationException

Exception thrown to signal a validation failure, optionally carrying a full IValidationResult so callers can surface all failures rather than a single message. (BR-044)

Purpose

  • Exception thrown to signal a validation failure, optionally carrying a full IValidationResult so callers can surface all failures rather than a single message. (BR-044)

Context

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

Public members

Member Signature Purpose
ValidationResult public IValidationResult ValidationResult { get; set; } The full set of validation failures associated with this exception, when constructed with one.
SaifValidationException() public SaifValidationException() Parameterless constructor.
SaifValidationException(IValidationResult validationResult) public SaifValidationException(IValidationResult validationResult) Constructs the exception carrying a pre-built validation result. (BR-044)
SaifValidationException(string errorMessage) public SaifValidationException(string errorMessage) Constructs the exception from a single free-text error message, wrapping it in a single-message ValidationResult internally. (BR-045)
SaifValidationException(string propertyName, string errorMessage) public SaifValidationException(string propertyName, string errorMessage) Constructs the exception from a single named-property failure. (BR-045)

Sources

  • Common/SAIF.Common/Classes/SaifValidationException.cs