コード例 #1
0
 /// <summary>
 /// Constructs the Context with the Database Options values provided
 /// </summary>
 /// <param name="options">The connection string and name of the Database to use</param>
 public ContextProvider(IDatabaseOptions options)
 {
     // Create the (Singleton) Client, Database and then return the Context ready for use
     Context = MongoProvider
               .CreateMongoClient(options.ConnectionString)
               .GetDatabase(options.DatabaseName)
               .GetCollection <T>(Pluralizer.Pluralize(typeof(T).Name));
 }