Example #1
0
        /**
         * Add delete query to list of queries
         */
        public override void RegisterDeleted(string collectionName, FilterDefinition <BsonDocument> filterDefinition)
        {
            IMongoCollection <BsonDocument> collection = DataSource.GetCollection(collectionName);
            DeleteMongoDbQuery  deleteQuery            = new DeleteMongoDbQuery(collection, filterDefinition);
            LoggingMongoDbQuery query = new LoggingMongoDbQuery(deleteQuery);

            Queries.Add(query);
        }
Example #2
0
        /**
         * Add creation query to list of queries
         */
        public override void RegisterNew(string collectionName, BsonDocument document)
        {
            IMongoCollection <BsonDocument> collection = DataSource.GetCollection(collectionName);
            CreateMongoDbQuery  createQuery            = new CreateMongoDbQuery(collection, document);
            LoggingMongoDbQuery query = new LoggingMongoDbQuery(createQuery);

            Queries.Add(query);
        }
Example #3
0
        public override void RegisterDirty(string collectionName, FilterDefinition <BsonDocument> filterDefinition,
                                           BsonDocument document)
        {
            IMongoCollection <BsonDocument> collection   = DataSource.GetCollection(collectionName);
            ReplaceMongoDbQuery             replaceQuery = new ReplaceMongoDbQuery(collection, filterDefinition, document);
            LoggingMongoDbQuery             query        = new LoggingMongoDbQuery(replaceQuery);

            Queries.Add(query);
        }
Example #4
0
        /**
         * Add update query to list of queries
         */
        public override void RegisterDirty(string collectionName, FilterDefinition <BsonDocument> filterDefinition,
                                           UpdateDefinition <BsonDocument> updateDefinition)
        {
            IMongoCollection <BsonDocument> collection = DataSource.GetCollection(collectionName);
            UpdateMongoDbQuery  updateQuery            = new UpdateMongoDbQuery(collection, filterDefinition, updateDefinition);
            LoggingMongoDbQuery query = new LoggingMongoDbQuery(updateQuery);

            Queries.Add(query);
        }