Click or drag to resize
ContractRequiresTException Method (Boolean, String)
Specifies a precondition contract for the enclosing method or property, and throws an exception with the provided message if the condition for the contract fails.

Namespace: Slash.Diagnostics.Contracts
Assembly: Slash.Diagnostics (in Slash.Diagnostics.dll) Version: 1.0.6018.40181
Syntax
public static void Requires<TException>(
	bool condition,
	string userMessage
)
where TException : Exception

Parameters

condition
Type: SystemBoolean
The conditional expression to test.
userMessage
Type: SystemString
The message to display if the condition is false.

Type Parameters

TException
The exception to throw if the condition is false.
See Also