dotnet / dotnet/dotnet-api-docs

ValidationAttribute documentation on MSDN does not correspond with documentation comments in source code

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

Description

https://docs.microsoft.com/en-us/dotnet/api/system.componentmodel.dataannotations.validationattribute?view=netcore-3.1
vs
https://github.com/dotnet/runtime/blob/master/src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/ValidationAttribute.cs

For example, the latter's doc comments for `IsValid(object)` state that "Derived classes should not override this method as it is only available for backwards compatibility." but this does not appear on MSDN.

Additionally, the code claims that `NotImplementedException` is thrown if `IsValid(object, ValidationContext)` has not been implemented by a derived class, which is obviously incorrect.

There are numerous other differences.

Please can the source and documentation be made consistent to reflect how `ValidationAttribute` should work and be used by developers.

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.