dotnet / dotnet/dotnet-api-docs

What validates `IValidateOptions<TOptions>.Validate(String, TOptions)`?

Open
#10,483 1 comment 0 reactions 0 assignees View on GitHub
area-System.ComponentModel.DataAnnotations Pri3 untriaged
Dominant language
C#
Stars
949
Forks
1.7k
Avg merge
3d 27m
Merged PRs (30d)
49

Description

### Type of issue

Typo

### Description

From https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.options.ivalidateoptions-1.validate?view=net-8.0#microsoft-extensions-options-ivalidateoptions-1-validate(system-string-0), essentialy from https://github.com/dotnet/runtime/blob/c4d7f7c6f2e2f34f07e64c6caa3bf9b2ce915cc1/src/libraries/Microsoft.Extensions.Options/src/IValidateOptions.cs

> Validates a specific named options instance (or all when name is null).

How is this supposed to work? I understand it like that all existing instances of `TOptions` are passed to _validation_ method. One at time. `string? name` parameter serves to validator to reason about `options` values.

I guess for description is wrong. I expect something like

> Validates a specific options instance optionally accompanied by its name for named instance.

### Page URL

https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.options.ivalidateoptions-1.validate?view=net-8.0#microsoft-extensions-options-ivalidateoptions-1-validate(system-string-0)

### Content source URL

https://github.com/dotnet/dotnet-api-docs/blob/main/xml/Microsoft.Extensions.Options/IValidateOptions`1.xml

### Document Version Independent Id

a47b7332-35e3-dcdc-f09d-5ecfd974f387

### Article author

@dotnet-bot

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.