public LibraryStatisticsDataMapper(IMongodbConnection connection) : base(connection)
 {
     if (Statistics == null)
     {
         Connection.Database.CreateCollection(collectionname);
     }
 }
Ejemplo n.º 2
0
        /// <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;
        }
Ejemplo n.º 3
0
        public BooksCollectedDataMapper(IMongodbConnection connection) : base(connection)
        {
            if (Books == null)
            {
                Connection.Database.CreateCollection(collectionname);
            }

            CreateIndexes();
        }
Ejemplo n.º 4
0
        public BookToBeReviewedDataMapper(IMongodbConnection connection) : base(connection)
        {
            if (BooksToReviewList == null)
            {
                Connection.Database.CreateCollection(collectionname);
            }

            CreateIndexes();
        }