The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
Contract::EnsuresOnThrow Method
.NET Framework (current version)
Specifies a postcondition contract for the enclosing method or property based on the provided exception and condition.
Assembly: mscorlib (in mscorlib.dll)
| Name | Description | |
|---|---|---|
![]() ![]() | EnsuresOnThrow<TException>(Boolean) | Specifies a postcondition contract for the enclosing method or property, based on the provided exception and condition. |
![]() ![]() | EnsuresOnThrow<TException>(Boolean, String^) | Specifies a postcondition contract and a message to display if the condition is false for the enclosing method or property, based on the provided exception and condition. |
Show:

