Table of Contents

Class ContractVersioningPipelineExtensions

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

Extension methods for adding contract versioning middleware to the dispatch pipeline.

public static class ContractVersioningPipelineExtensions
Inheritance
ContractVersioningPipelineExtensions
Inherited Members

Methods

UseContractVersioning(IDispatchBuilder)

Adds contract version checking middleware to the dispatch pipeline.

public static IDispatchBuilder UseContractVersioning(this IDispatchBuilder builder)

Parameters

builder IDispatchBuilder

The dispatch builder.

Returns

IDispatchBuilder

The builder for fluent configuration.

Remarks

The contract versioning middleware validates message contract versions, ensuring that handlers receive messages compatible with their expected schema.

Contract versioning services must be registered separately in the DI container. This method only adds the middleware to the pipeline.

Recommended pipeline order:

builder.UseAuthentication()
       .UseAuthorization()
       .UseContractVersioning()   // Validate version before handler
       .UseValidation()
       .UseRetry();