Contract.EnsuresOnThrow Method

 

Specifies a postcondition contract for the enclosing method or property based on the provided exception and condition.

Namespace:   System.Diagnostics.Contracts
Assembly:  mscorlib (in mscorlib.dll)

NameDescription
System_CAPS_pubmethodSystem_CAPS_staticEnsuresOnThrow<TException>(Boolean)

Specifies a postcondition contract for the enclosing method or property, based on the provided exception and condition.

System_CAPS_pubmethodSystem_CAPS_staticEnsuresOnThrow<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.

Return to top
Show: