Skip to main content
Version: 0.3.x (0.3.0)

Class ValueObjectInputServiceCollectionExtensions

Namespace: AdCodicem.ValueObjects.Blazor
Assembly: AdCodicem.ValueObjects.Blazor.dll

Registers the options of the inputs of value objects.

public static class ValueObjectInputServiceCollectionExtensions

Inheritance​

object ← ValueObjectInputServiceCollectionExtensions

Inherited Members​

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()

Methods​

AddValueObjectInputs(IServiceCollection, Action<ValueObjectInputOptions>)​

Configures the messages the inputs of value objects answer a refusal with, and registers the localization services they are read through.

public static IServiceCollection AddValueObjectInputs(this IServiceCollection services, Action<ValueObjectInputOptions> configure)

Parameters​

services IServiceCollection

The application's services.

configure Action<ValueObjectInputOptions>

Configures the options: options => options.UseResource<Messages>().

Returns​

IServiceCollection

The services, so calls can be chained.

Remarks​

An input needs no registration to read text through its value object's rules, and answers a refusal with the English message of the rule without one. AddLocalization() keeps the localizer factory the application registered first, and its ResourcesPath.

Exceptions​

ArgumentNullException

services or configure is null.