Can't Change Id Element Name To "Id"

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Duplicate
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      My Saves are not working. Mongo says I am trying to insert a document with a duplicate key. I think it's because my objects are serializing with key of "_id" instead of "Id". So I map this like this:

      BsonClassMap.RegisterClassMap<Foo>(x => {
      x.AutoMap();
      var memberMap = x.GetMemberMap(c => c.Id)
      .SetIdGenerator(CombGuidGenerator.Instance)
      .SetRepresentation(BsonType.String);;
      x.SetIdMember(memberMap);
      x.IdMemberMap.SetElementName("Id");
      });

      By my documents still serialize with "_id".

            Assignee:
            Robert Stam (Inactive)
            Reporter:
            Tim Scott
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: