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