Share via


ValidationResult<TResult,TError> Struct

Definition

Represents a validation result that can be either valid or invalid.

public readonly struct ValidationResult<TResult,TError> : IEquatable<Microsoft.IdentityModel.Tokens.Experimental.ValidationResult<TResult,TError>>
type ValidationResult<'Result, 'Error> = struct
Public Structure ValidationResult(Of TResult, TError)
Implements IEquatable(Of ValidationResult(Of TResult, TError))

Type Parameters

TResult
TError
Inheritance
ValidationResult<TResult,TError>
Implements
IEquatable<ValidationResult<TResult,TError>>

Constructors

ValidationResult<TResult,TError>()
Obsolete.

Empty constructor implementation to prevent creating an empty result.

ValidationResult<TResult,TError>(TError)

Creates a new instance of ValidationResult<TResult,TError> indicating a failed operation and containing an error information.

ValidationResult<TResult,TError>(TResult)

Creates a new instance of ValidationResult<TResult,TError> indicating a successful operation and containing an object of the associated type.

Properties

Error

Gets the error associated with the validation result.

IsValid

Gets a value indicating whether the result is valid.

Result

Gets the result associated with the validation result.

Methods

Equals(Object)

Determines whether the specified object is equal to the current instance of ValidationResult<TResult,TError>.

Equals(ValidationResult<TResult,TError>)

Determines whether the specified ValidationResult<TResult,TError> is equal to the current instance.

GetHashCode()

Returns the hash code for this instance of ValidationResult<TResult,TError>.

ToValidationResult()

Casts the result to a ValidationResult<TResult,TError>.

Operators

Equality(ValidationResult<TResult,TError>, ValidationResult<TResult,TError>)

Equality comparison operator for ValidationResult<TResult,TError>.

Implicit(TError to ValidationResult<TResult,TError>)
Implicit(TResult to ValidationResult<TResult,TError>)
Inequality(ValidationResult<TResult,TError>, ValidationResult<TResult,TError>)

Inequality comparison operator for ValidationResult<TResult,TError>.

Applies to