ArgumentEmtpyGuard.

ThrowIfIsNullOrWhiteSpace(string, string) Method

Summary

Throws an System.ArgumentNullException if the argument is null or whitespace.
Namespace
oehen.arguard
Containing Type
ArgumentEmtpyGuard

Syntax

public static string ThrowIfIsNullOrWhiteSpace(this string argument, string nameOfArgument)

Examples

How to validate argument `stringArgument`.

var localVar = stringArgument.ThrowIfIsNullOrWhiteSpace(nameof(stringArgument));

Parameters

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

Return Value

Type Description
string
GitHub