ArgumentDateTimeTodayGuard.

ThrowIfIsLessThanToday(DateTime, string) Method

Summary

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

Syntax

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

Examples

Throws when argument is less than System.DateTime.Today.

var localVar = argument.ThrowIfLessThanToday(nameof(argument));

Parameters

Name Type Description
argument DateTime Argument value.
nameOfArgument string Name of the argument.

Return Value

Type Description
DateTime
GitHub