Table of Contents

Class ValidationDispatchBuilderExtensions

Namespace
Microsoft.Extensions.DependencyInjection
Assembly
Excalibur.Dispatch.dll

Extension methods for configuring message validation in the dispatch builder. Provides methods to register validation services and configure custom validators.

public static class ValidationDispatchBuilderExtensions
Inheritance
ValidationDispatchBuilderExtensions
Inherited Members

Methods

UseValidation(IDispatchBuilder)

Adds dispatch validation services to the builder. Registers default validation infrastructure including validator resolvers and validation middleware for message processing.

public static IDispatchBuilder UseValidation(this IDispatchBuilder builder)

Parameters

builder IDispatchBuilder

The dispatch builder to configure.

Returns

IDispatchBuilder

The dispatch builder for method chaining.

Exceptions

ArgumentNullException

Thrown when builder is null.

WithCustomValidators(IDispatchBuilder, Action<IServiceCollection>)

Configures custom message validators for the dispatch system. Allows registration of domain-specific validators for message types through the provided service collection configuration action.

public static IDispatchBuilder WithCustomValidators(this IDispatchBuilder builder, Action<IServiceCollection> registerValidators)

Parameters

builder IDispatchBuilder

The dispatch builder to configure.

registerValidators Action<IServiceCollection>

Action to register custom validators with the service collection.

Returns

IDispatchBuilder

The dispatch builder for method chaining.

Exceptions

ArgumentNullException

Thrown when builder or registerValidators is null.