Table of Contents

Class OptionsBuilderExtensions

Namespace
Excalibur.Application
Assembly
Excalibur.Application.dll

Provides extension methods for validating options using FluentValidation.

public static class OptionsBuilderExtensions
Inheritance
OptionsBuilderExtensions
Inherited Members

Methods

Validate<TOptions, TValidator>(OptionsBuilder<TOptions>)

Adds validation to the options builder using a specified validator type.

public static void Validate<TOptions, TValidator>(this OptionsBuilder<TOptions> builder) where TOptions : class, new() where TValidator : IValidator<TOptions>, new()

Parameters

builder OptionsBuilder<TOptions>

The options builder to which validation is added.

Type Parameters

TOptions

The type of options being validated.

TValidator

The type of the validator to use for validation.

Remarks

This extension integrates FluentValidation into the options validation process. It supports rule sets if the validator implements IDetermineValidationRuleSetByConfig<T>.

Exceptions

ValidationException

Thrown when the validation of the options instance fails.