Summary
Specifies a precondition.
Syntax
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[ContractAnnotation("condition:false=>stop")]
public static void Requires<TException>(bool condition) where TException : Exception, new()
Attributes
Type | Description |
---|---|
MethodImplAttribute | |
ContractAnnotation |
Type Parameters
Name | Description |
---|---|
TException | The exception to throw if condition is false. |
Parameters
Name | Type | Description |
---|---|---|
condition | bool | The precondition. |
Return Value
Type | Description |
---|---|
void |