Find by Id - such a common task, should there be a method for it on MongoCollection<T>?

XMLWordPrintableJSON

    • Type: New Feature
    • Resolution: Done
    • Priority: Minor - P4
    • 0.9
    • Affects Version/s: 0.7
    • Component/s: Feature Request
    • None
    • Environment:
      N/A
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      It seems that loading an object by it's ID is a very common task. This leads to a lot of repetitive code. If a MongoCollection provided a FindOneById(ObjectId id) method that duplicate code could be eliminated.

      In MongoCollection.cs on MongoCollection<T>

      public TDefaultDocument FindOneById (ObjectId id)

      { return FindOne(Query.EQ("_id", id)); }

            Assignee:
            Robert Stam
            Reporter:
            Ian Mercer
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: