Table of Contents

Class DomainValidationAttribute

Namespace
JD.Domain.AspNetCore
Assembly
JD.Domain.AspNetCore.dll

Action filter attribute that performs domain validation on action parameters.

[AttributeUsage(AttributeTargets.Class|AttributeTargets.Method, AllowMultiple = true)]
public sealed class DomainValidationAttribute : Attribute, IAsyncActionFilter, IFilterMetadata
Inheritance
DomainValidationAttribute
Implements
Inherited Members

Properties

RuleSet

Gets or sets the rule set to evaluate.

public string? RuleSet { get; set; }

Property Value

string

StopOnFirstError

Gets or sets whether to stop on first error.

public bool StopOnFirstError { get; set; }

Property Value

bool

ValidationType

Gets or sets the type to validate. If null, validates all class parameters.

public Type? ValidationType { get; set; }

Property Value

Type

Methods

OnActionExecutionAsync(ActionExecutingContext, ActionExecutionDelegate)

Called asynchronously before the action, after model binding is complete.

public Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)

Parameters

context ActionExecutingContext

The ActionExecutingContext.

next ActionExecutionDelegate

The ActionExecutionDelegate. Invoked to execute the next action filter or the action itself.

Returns

Task

A Task that on completion indicates the filter has executed.