Summary
Throws an
InvalidOperationException if argument is
less thanDateTime.Now.
- Namespace
- oehen
.arguard - Containing Type
- Argument
Date Time Now Guard
Syntax
public static DateTime ThrowIfIsLessThanNow(this DateTime argument, string nameOfArgument)
Examples
Throws when argument is less than DateTime.Now.
var localVar = argument.ThrowIfIsLessThanNow(nameof(argument));
Parameters
| Name | Type | Description |
|---|---|---|
| argument | DateTime | Argument value. |
| nameOfArgument | string | Name of the argument. |
Return Value
| Type | Description |
|---|---|
| DateTime |