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

Create DBRefs with conventions

    • Type: Icon: New Feature New Feature
    • Resolution: Won't Fix
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 1.0
    • Component/s: None

      Instead of polluting your model with MongoDB specific classes like MongoDBRef, you should be able to handle it via conventions. For example,
      If I have a model class with a foreign key reference like the following:
      public class Employee{
      public object Id;
      public object Manager_Id;
      }

      I can create a convention where "Manager" is the collection name and "Id" is the field to join on. When a save occurs, the driver can detect this convention and apply the $ref appropriately.

            Assignee:
            robert@mongodb.com Robert Stam
            Reporter:
            jon.eckstein Jon Eckstein
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: