Table of Contents

Method AddCommandLineSettingsFluentValidation

Namespace
Ploch.CommandLine.Spectre.FluentValidation
Assembly
Ploch.CommandLine.Spectre.FluentValidation.dll

AddCommandLineSettingsFluentValidation(IServiceCollection, Action<AssemblyListBuilder>)

Registers FluentValidation as the command settings validator and discovers validators from the assemblies selected by validatorAssembliesBuilderAction.

public static IServiceCollection AddCommandLineSettingsFluentValidation(this IServiceCollection services, Action<AssemblyListBuilder> validatorAssembliesBuilderAction)

Parameters

services IServiceCollection

The service collection to add the registrations to.

validatorAssembliesBuilderAction Action<AssemblyListBuilder>

A delegate selecting the assemblies scanned for validators.

Returns

IServiceCollection

The same services instance, to allow chaining.