PostSharp 2023.0 / / Post­Sharp Documentation / API Reference / Post­Sharp.​Patterns.​Contracts Namespace / Contract­Services Class

ContractServices Class

This class provides services supporting Contract aspects. By adding your own classes to the ExceptionFactory chain, you can change the way the exceptions are created when a contract is broken. By plugging into the LocalizedTextProvider chain, you can change the way the exception messages are generated. See the documentation for the classes for more details: ContractLocalizedTextProvider, ContractExceptionFactory.
Inheritance Hierarchy

Namespace:  PostSharp.Patterns.Contracts
Assembly:  PostSharp.Patterns.Common (in PostSharp.Patterns.Common.dll) Version: 2023.0.3.0 (2023.0.3.0)
public static class ContractServices

The ContractServices type exposes the following members.

Public propertyStatic memberExceptionFactory
Gets the head of the ContractExceptionFactory responsibility chain.
Public propertyStatic memberLocalizedTextProvider
Gets the head of the ContractLocalizedTextProvider responsibility chain.
See Also