dotnet / dotnet-api-docs

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

Incorrect CustomValidationAttribute remarks #3126

Open hrobertson opened 5 years ago

hrobertson commented 5 years ago

Content: https://docs.microsoft.com/en-us/dotnet/api/system.componentmodel.dataannotations.customvalidationattribute.method?view=netcore-2.2 Content source: xml/System.ComponentModel.DataAnnotations/CustomValidationAttribute.xml

The remarks for the Method property of CustomValidationAttribute incorrectly state that the specified method must return a Boolean and takes a ValidationResult out param. In .Net Core 2.2 at least, it must return a ValidationResult.

Maybe the signature is different in different languages?

Additionally, it would be preferable to have the valid signatures listed as code snippets rather than described in text.

mairaw commented 5 years ago

Thank you for your feedback @hrobertson.

@lajones, @divega, @ajcvickers can you help with this issue? Are there differences in behavior between .NET Framework and .NET Core for this API? Thanks.

hrobertson commented 5 years ago

Doesn't look like it: https://referencesource.microsoft.com/#System.ComponentModel.DataAnnotations/DataAnnotations/CustomValidationAttribute.cs,db5138ec9e85f648