[CSHARP-293] Add some additional information to error message when mapping a class results in duplicate element name Created: 31/Jul/11  Updated: 02/Apr/15  Resolved: 03/Aug/11

Status: Closed
Project: C# Driver
Component/s: None
Affects Version/s: 1.1
Fix Version/s: 1.2

Type: Improvement Priority: Minor - P4
Reporter: Robert Stam Assignee: Robert Stam
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

When mapping a class results in duplicate element names, provide a few additional pieces of information (beyond what's already being provided).

1. Is the conflicting member a field or a property
2. Is the existing member a field or a property
3. Which class is the existing member in

For example given:

public class C {
public ObjectId;
public int N;
}

public class D : C {
public new int N

{ get; set; }

}

The error message should read something along the lines of:

"The property 'N' of class 'D' cannot use element name 'N' because it is already being used by field 'N' of class 'C'.

The current error message is:

"Member 'N' of class 'D' cannot use element name 'N' because it is already being used by member 'N'."

which doesn't make clear that the conflicting instance of 'N' is in a base class.


Generated at Wed Feb 07 21:36:24 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.