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

Mapping of subclass members doesn't work

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • None
    • Windows

    Description

      Consider this mapping of a subclass that has a property that I want ignored:

      mapping.DefaultProfile(profile =>

      { profile.SubClassesAre(t => t.IsSubclassOf(typeof(MyAbstract))); }

      );
      mapping.Map<MyConcrete>(c =>

      { c.Member(x => x.MyProperty).Ignore(); }

      );

      The MyProperty of MyConcrete (which is a subclass of MyAbstract) doesn´t get ignored until I add this:

      mapping.Map<MyAbstract>(f =>

      { f.Member(x => x.MyProperty).Ignore(); }

      );

      This is works for my case but I can foresee cases where I would want one concrete class to ignore this property of the abstract while I would want to include it in another.

      Attachments

        Activity

          People

            craig.wilson@mongodb.com Craig Wilson
            nisbus nisbus
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: