Table of Contents

Class AsyncValidationRule<TEntity>

Namespace
GroupeIsa.Neos.Domain.Rules.ValidationRules
Assembly
GroupeIsa.Neos.Domain.Abstractions.dll

Represents a validation rule.

public abstract class AsyncValidationRule<TEntity> : IValidationRule<TEntity>, IValidationRule where TEntity : BusinessEntity

Type Parameters

TEntity

The entity type.

Inheritance
AsyncValidationRule<TEntity>
Implements
Derived
Inherited Members

Constructors

AsyncValidationRule(IValidationRule<TEntity>?)

Initializes a new instance of the AsyncValidationRule<TEntity> class.

protected AsyncValidationRule(IValidationRule<TEntity>? baseImplementation = null)

Parameters

baseImplementation IValidationRule<TEntity>

Base implementation.

Properties

Arguments

Gets or sets the arguments.

public IValidationRuleArguments Arguments { get; set; }

Property Value

IValidationRuleArguments

Item

Gets or sets the item.

public TEntity Item { get; set; }

Property Value

TEntity

Repository

Gets the repository handling the validated Item.

protected IRepository? Repository { get; }

Property Value

IRepository

Methods

Error(string)

Returns an error.

protected static IValidationRuleResult Error(string message)

Parameters

message string

The message.

Returns

IValidationRuleResult

The result.

ExecuteAsync()

Executes the validation rule.

public virtual Task<IValidationRuleResult> ExecuteAsync()

Returns

Task<IValidationRuleResult>

A task that represents the result of the validation rule.

ExecuteAsync(CancellationToken)

Executes the validation rule.

public virtual Task<IValidationRuleResult> ExecuteAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

A CancellationToken that can be used to cancel the operation.

Returns

Task<IValidationRuleResult>

A task that represents the result of the validation rule.

GetOriginal()

Gets the original state of the validated Item.

protected TEntity GetOriginal()

Returns

TEntity

The item in its original state.

Success()

Returns a success.

protected static IValidationRuleResult Success()

Returns

IValidationRuleResult

The result.