ArgumentDateTimeNowGuard.

ThrowIfIsLessThanNow(DateTime, string) Method

Summary

Throws an System.InvalidOperationException if argument is less thanSystem.DateTime.Now.
Namespace
oehen.arguard
Containing Type
ArgumentDateTimeNowGuard

Syntax

public static DateTime ThrowIfIsLessThanNow(this DateTime argument, string nameOfArgument)

Examples

Throws when argument is less than System.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
GitHub