<PackageReference Include="Microsoft.Extensions.Options" Version="11.0.0-preview.5.26302.115" />

Microsoft.Extensions.Options.ValidateOptionsResultBuilder

Builds ValidateOptionsResult with support for multiple error messages.

Creates new instance of the ValidateOptionsResultBuilder class.

public void AddError(string error, string propertyName = null)

Adds a new validation error to the builder.

public void AddResult(ValidationResult result)

Adds any validation error carried by the ValidationResult instance to this instance.

public void AddResult(ValidateOptionsResult result)

Adds any validation errors carried by the ValidateOptionsResult instance to this instance.

public void AddResults(IEnumerable<ValidationResult> results)

Adds any validation error carried by the enumeration of ValidationResult instances to this instance.

Builds ValidateOptionsResult based on provided data.

public void Clear()

Reset the builder to the empty state.