public LibraryStatisticsDataMapper(IMongodbConnection connection) : base(connection) { if (Statistics == null) { Connection.Database.CreateCollection(collectionname); } }
/// <summary> /// Reads configuration from the app.config and initializes the data mapper /// </summary> /// <param name="connection">A .net connection that implements IDbConnection</param> protected MongodbDataMapper(IMongodbConnection connection) { if (connection == null) { throw new ArgumentNullException("Database connection cannot be null."); } this.Connection = connection; }
public BooksCollectedDataMapper(IMongodbConnection connection) : base(connection) { if (Books == null) { Connection.Database.CreateCollection(collectionname); } CreateIndexes(); }
public BookToBeReviewedDataMapper(IMongodbConnection connection) : base(connection) { if (BooksToReviewList == null) { Connection.Database.CreateCollection(collectionname); } CreateIndexes(); }