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

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

Open IanKemp opened 4 years ago

IanKemp commented 4 years ago

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.

carlossanlop commented 4 years ago

Adding area owners @lajones @ajcvickers for triaging.