コード例 #1
0
        public void Create_Success()
        {
            var provider = new MongoDatabaseProvider(Options.Create(_options));

            var client = provider.Create();

            Assert.AreEqual(client.DatabaseNamespace.DatabaseName, _options.DatabaseName);
        }
コード例 #2
0
 public MongoRepositoryTest()
 {
     Provider = new MongoDatabaseProvider(Options.Create(MongoOptions));
     Client   = Provider.Create();
 }
コード例 #3
0
 /// <summary>
 /// Construtor do repositório.
 /// </summary>
 /// <param name="mongoDatabaseProvider">Fornecedor da conexão com o banco de dados.</param>
 public MongoRepository(MongoDatabaseProvider mongoDatabaseProvider)
 {
     _mongoDatabaseProvider = mongoDatabaseProvider;
     _collection            = _mongoDatabaseProvider.Create().GetCollection <T>(TableName());
 }