dotnet / dotnet/dotnet-api-docs

Several errors in ValidationException(String, Exception) constructor

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

Description

### Type of issue

Outdated article

### Description

[ValidationException(String, Exception)](https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.dataannotations.validationexception.-ctor?view=net-8.0#system-componentmodel-dataannotations-validationexception-ctor(system-string-system-exception)) has a few errors:

1. The description says, "Initializes a new instance of the ValidationException class using a specified error message and a collection of inner exception instances.". Instead of "a collection of inner exception instances", it should say "an inner exception", matching the signature (a single Exception).

2. Similarly, the parameter is documented as "The collection of validation exceptions", but should say "the Exception that caused this exception" (the signature is Exception, not ValidationException and not a collection).

3. The Remarks say, "You typically will not use this constructor because validation exceptions are stored in the [InnerExceptions](https://learn.microsoft.com/en-us/dotnet/api/system.web.dynamicdata.idynamicvalidatorexception.innerexceptions?view=net-8.0#system-web-dynamicdata-idynamicvalidatorexception-innerexceptions) property, not innerException." The InnerExceptions link goes to System.Web.DynamicData.IDynamicValidatorException. That namespace does not exist at all in .NET Core. The Remarks should be removed entirely.

### Page URL

https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.dataannotations.validationexception.-ctor?view=net-8.0

### Content source URL

https://github.com/dotnet/dotnet-api-docs-temp/blob/live/xml/System.ComponentModel.DataAnnotations/ValidationException.xml

### Document Version Independent Id

3835e2b6-232f-3985-766f-4fdc001d58a3

### Platform Id

22bc142f-01a3-6a20-8996-a8d75c704306

### 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.