Table of Contents

ThrowIfNullOrEmpty Method

Definition

Namespace
Cuemon
Assemblies
Cuemon.Kernel.dll
Source
src/Cuemon.Kernel/Validator.cs

ThrowIfNullOrEmpty(string, string, string)

Validates and throws either an ArgumentNullException or ArgumentException if the specified argument is respectively null or empty.

public static void ThrowIfNullOrEmpty(string argument, string message = null, string paramName = null)

Parameters

argument string

The value to be evaluated.

message string

A message that describes the error to your liking.

paramName string

The name of the parameter that caused the exception.

Exceptions

ArgumentNullException

argument cannot be null.

ArgumentException

argument cannot be empty.