namespace New.Domain; /// /// Thrown whenever a domain invariant is violated - by native creation of a /// , or by the legacy mapper feeding data /// through the same validating constructors/factories during adoption. /// /// is a short, stable, machine-friendly code (e.g. /// "Bsn.ElevenProof", "Assessment.MotivationTooShort") that callers such as /// New.Api can surface directly in a 422 response body without needing to /// parse the human-readable . /// public sealed class DomainInvariantViolationException : Exception { public string Invariant { get; } public DomainInvariantViolationException(string invariant, string message) : base(message) { Invariant = invariant; } }