dotnet / dotnet-api-docs

.NET API reference documentation (.NET 5+, .NET Core, .NET Framework)
https://docs.microsoft.com/dotnet/api/
Other
718 stars 1.56k forks source link

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

Open bravequickcleverfibreyarn opened 2 weeks ago

bravequickcleverfibreyarn commented 2 weeks ago

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

dotnet-policy-service[bot] commented 2 weeks ago

Tagging subscribers to this area: @ajcvickers