Table of Contents

Class BusinessRuleValidationException

Namespace
Compendium.Core.Domain.Rules
Assembly
Compendium.Core.dll

Exception thrown when a business rule validation fails. This exception should be caught at the application boundary and converted to appropriate error responses.

public sealed class BusinessRuleValidationException : Exception, ISerializable
Inheritance
BusinessRuleValidationException
Implements
Inherited Members

Constructors

BusinessRuleValidationException(IBusinessRule)

Initializes a new instance of the BusinessRuleValidationException class.

public BusinessRuleValidationException(IBusinessRule brokenRule)

Parameters

brokenRule IBusinessRule

The business rule that was broken.

BusinessRuleValidationException(IBusinessRule, Exception)

Initializes a new instance of the BusinessRuleValidationException class.

public BusinessRuleValidationException(IBusinessRule brokenRule, Exception innerException)

Parameters

brokenRule IBusinessRule

The business rule that was broken.

innerException Exception

The exception that is the cause of the current exception.

Properties

BrokenRule

Gets the business rule that was broken.

public IBusinessRule BrokenRule { get; }

Property Value

IBusinessRule

ErrorCode

Gets the error code that uniquely identifies the type of business rule violation.

public string ErrorCode { get; }

Property Value

string

Methods

ToString()

Returns a string representation of the exception.

public override string ToString()

Returns

string

A string that represents the current exception.