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