Table of Contents

ThrowIfEnumType Method

Definition

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

ThrowIfEnumType(Type, string, string)

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

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

Parameters

argument Type

The type to check is an enumeration.

message string

A message that describes the error.

paramName string

The name of the type parameter that caused the exception.

Remarks

This method will not throw an exception if argument is null.

Exceptions

ArgumentException

argument represents an enumeration.

ThrowIfEnumType<TEnum>(string, string)

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

public static void ThrowIfEnumType<TEnum>(string typeParamName, string message = "Value 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 an enumeration.

Exceptions

TypeArgumentException

TEnum represents an enumeration.