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

New GetCollection<T>() signature that uses a default collection name based on the Type of collection (NORM migration suggestion)

    XMLWordPrintableJSON

Details

    • Icon: New Feature New Feature
    • Resolution: Won't Do
    • Icon: Minor - P4 Minor - P4
    • None
    • 0.7
    • Feature Request
    • None
    • Win 7, .NET 4, VS 2010

    Description

      If GetCollection<T> had a method that took no argument it would be easier for people to migrate from Norm to this driver. Simply construct a default collection name based on the type in use:-

      e.g. in MongoDatabase.cs

      public MongoCollection<TDefaultDocument> GetCollection<TDefaultDocument>()

      { string collectionName = typeof(TDefaultDocument).Name; return GetCollection<TDefaultDocument>(collectionName, safeMode); }

      This makes quick start / simple / common examples just a bit simpler and less error prone as there's no string value to get right.

      Attachments

        Activity

          People

            Unassigned Unassigned
            ianmercer Ian Mercer
            Votes:
            7 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: