Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-293

Add some additional information to error message when mapping a class results in duplicate element name

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 1.2
    • Affects Version/s: 1.1
    • Component/s: None
    • Labels:
      None

      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.

            Assignee:
            robert@mongodb.com Robert Stam
            Reporter:
            robert@mongodb.com Robert Stam
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: