Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

class Microsoft.​Extensions.​Options.​ValidateOptionsResultBuilder

Assembly: Microsoft.Extensions.Options

Inheritance: object → ValidateOptionsResultBuilder

Builds <see cref="T:Microsoft.Extensions.Options.ValidateOptionsResult" /> with support for multiple error messages.

Methods

public void
AddError​(string error, string propertyName = null)
Adds a new validation error to the builder.
error The content of the error message.
propertyName The property in the option object which contains an error.
public void
AddResult​(ValidateOptionsResult result)
Adds any validation errors carried by the <see cref="T:Microsoft.Extensions.Options.ValidateOptionsResult" /> instance to this instance.
result The instance to consume the errors from.
public void
AddResult​(System.​ComponentModel.​DataAnnotations.​ValidationResult result)
Adds any validation error carried by the <see cref="T:System.ComponentModel.DataAnnotations.ValidationResult" /> instance to this instance.
result The instance to append the error from.
public void
AddResults​(System.​Collections.​Generic.​IEnumerable<​System.​ComponentModel.​DataAnnotations.​ValidationResult> results)
Adds any validation error carried by the enumeration of <see cref="T:System.ComponentModel.DataAnnotations.ValidationResult" /> instances to this instance.
results The enumeration to consume the errors from.
Build​()
Builds <see cref="T:Microsoft.Extensions.Options.ValidateOptionsResult" /> based on provided data.
Returns A new instance of <see cref="T:Microsoft.Extensions.Options.ValidateOptionsResult" /> .
public void
Clear​()
Reset the builder to the empty state.
public bool
Equals​(object obj)
Inherited from object
protected void
Finalize​()
Inherited from object
public int
GetHashCode​()
Inherited from object
GetType​()
Inherited from object
protected object
MemberwiseClone​()
Inherited from object
public string
ToString​()
Inherited from object