Table of Contents

ThrowIfNotEnumType Method

Definition

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

ThrowIfNotEnumType<TEnum>(string, string)

Validates and throws a TypeArgumentException if the specified TEnum does not represents an enumeration.

public static void ThrowIfNotEnumType<TEnum>(string typeParamName, string message = "Value does not represents an enumeration.")

Parameters

typeParamName string

The name of the type parameter that caused the exception.

message string

A message that describes the error.

Type Parameters

TEnum

The type to check is not an enumeration.

Exceptions

TypeArgumentException

TEnum does not represents an enumeration.

ThrowIfNotEnumType(Type, string, string)

Validates and throws an ArgumentException if the specified argument does not represents an enumeration.

public static void ThrowIfNotEnumType(Type argument, string message = "Value does not represents an enumeration.", string paramName = null)

Parameters

argument Type

The type to check is not an enumeration.

message string

A message that describes the error.

paramName string

The name of the type parameter that caused the exception.

Exceptions

ArgumentException

argument does not represents an enumeration.