ValidationResult<TResult,TError> Constructors

Definition

Overloads

Name Description
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 validation and containing error information.

ValidationResult<TResult,TError>(TResult)

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

ValidationResult<TResult,TError>()

Caution

Cannot create an empty validation result

Empty constructor implementation to prevent creating an empty result.

[System.Obsolete("Cannot create an empty validation result", true)]
public ValidationResult();
Public Sub New ()
Attributes

Exceptions

Thrown when called.

Remarks

Throws an InvalidOperationException when called as this should never be used. Always initialize Result with either a value or error.

Applies to

ValidationResult<TResult,TError>(TError)

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

public ValidationResult(TError error);
new Microsoft.IdentityModel.Tokens.Experimental.ValidationResult<'Result, 'Error (requires 'Error :> Microsoft.IdentityModel.Tokens.Experimental.ValidationError)> : 'Error -> Microsoft.IdentityModel.Tokens.Experimental.ValidationResult<'Result, 'Error (requires 'Error :> Microsoft.IdentityModel.Tokens.Experimental.ValidationError)>
Public Sub New (error As TError)

Parameters

error
TError

The error associated with the failure.

Applies to

ValidationResult<TResult,TError>(TResult)

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

public ValidationResult(TResult result);
new Microsoft.IdentityModel.Tokens.Experimental.ValidationResult<'Result, 'Error (requires 'Error :> Microsoft.IdentityModel.Tokens.Experimental.ValidationError)> : 'Result -> Microsoft.IdentityModel.Tokens.Experimental.ValidationResult<'Result, 'Error (requires 'Error :> Microsoft.IdentityModel.Tokens.Experimental.ValidationError)>
Public Sub New (result As TResult)

Parameters

result
TResult

The value associated with the success.

Applies to