Example #1
0
        public IEnumerable <Watch> GetSomeData(ConnectionMongoDB connection, int skip, int limit)
        {
            IMongoCollection <Watch> collection = connection.DB.GetCollection <Watch>(collectionName);
            var filter  = new BsonDocument();
            var watches = collection.Find(filter).Skip(skip).Limit(limit).ToList();

            return(watches);
        }
Example #2
0
        public IEnumerable <Watch> GetData(ConnectionMongoDB connection)
        {
            IMongoCollection <Watch> collection = connection.DB.GetCollection <Watch>(collectionName);
            var filter  = new BsonDocument();
            var watches = collection.Find(filter).ToList();

            return(watches);
        }
Example #3
0
        public void Add(ConnectionMongoDB connection, SubscribeUser user)
        {
            IMongoCollection <SubscribeUser> collection = connection.DB.GetCollection <SubscribeUser>(collectionName);

            collection.InsertOne(user);
        }
Example #4
0
 public SubscribeUsers(ISubscribeContex _contex)
 {
     contex     = _contex;
     connection = new ConnectionMongoDB(connectionDB, dbName);
 }
Example #5
0
 public Watches(IWatchContex _contex)
 {
     contex     = _contex;
     connection = new ConnectionMongoDB(connectionDB, dbName);
 }