Table of Contents

Class EnumValidationExtensions

Namespace
Admonish
Assembly
Admonish.dll

Contains enum-related validation extension methods of ValidationResult.

public static class EnumValidationExtensions
Inheritance
EnumValidationExtensions
Inherited Members

Methods

IsDefined<TEnum>(ValidationResult, string, TEnum, string?)

Ensures that the specified value is defined in the specified enum type. When the check fails, adds an error message to the ValidationResult and associates it with the specified key.

public static ValidationResult IsDefined<TEnum>(this ValidationResult r, string key, TEnum value, string? message = null) where TEnum : Enum

Parameters

r ValidationResult

The validation result.

key string

The key to associate the error with.

value TEnum

The value to check.

message string

An optional error message.

Returns

ValidationResult

The validation result.

Type Parameters

TEnum