Exemplo n.º 1
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="mongoClientSettings">The settings for a MongoDB client.</param>
 /// <param name="dbName">数据库名称</param>
 /// <param name="collectionName">集合名称</param>
 /// <param name="writeConcern"></param>
 /// <param name="readPreference"></param>
 /// <param name="sequence">Mongo自增长ID数据序列对象</param>
 public MongoBaseRepository(MongoClientSettings mongoClientSettings, string dbName, string collectionName = null, WriteConcern writeConcern = null, ReadPreference readPreference = null, MongoSequence sequence = null)
     : this()
 {
     this._sequence      = sequence ?? new MongoSequence();
     this._mongoSession  = new MongoSession(mongoClientSettings, dbName, writeConcern: writeConcern, readPreference: readPreference);
     this.CollectionName = collectionName ?? typeof(TEntity).Name;
 }
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="connString">数据库连接节点</param>
 /// <param name="dbName">数据库名称</param>
 /// <param name="collectionName">集合名称</param>
 /// <param name="writeConcern"></param>
 /// <param name="readPreference"></param>
 /// <param name="sequence">Mongo自增长ID数据序列对象</param>
 public MongoReaderRepositoryAsync(string connString, string dbName, string collectionName = null, WriteConcern writeConcern = null, ReadPreference readPreference = null, MongoSequence sequence = null) : base(connString, dbName, collectionName, writeConcern, readPreference, sequence)
 {
 }
Exemplo n.º 3
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="connString">数据库连接节点</param>
 /// <param name="dbName">数据库名称</param>
 /// <param name="collectionName">集合名称</param>
 /// <param name="writeConcern"></param>
 /// <param name="readPreference"></param>
 /// <param name="sequence">Mongo自增长ID数据序列对象</param>
 public MongoBaseRepository(string connString, string dbName, string collectionName = null, WriteConcern writeConcern = null, ReadPreference readPreference = null, MongoSequence sequence = null)
 {
     this._sequence      = (sequence ?? new MongoSequence());
     this._mongoSession  = new MongoSession(connString, dbName, writeConcern, false, readPreference);
     this.CollectionName = (collectionName ?? typeof(TEntity).Name);
 }