Exemplo n.º 1
0
        public object FindAndModifyAs(Type documentType, IMongoQuery query, IMongoSortBy sortBy, IMongoUpdate update, IMongoFields fields, bool returnNew, bool upsert, out UpdateResult result)
        {
            var args = new FindAndModifyArgs();

            args.Query           = query;
            args.SortBy          = sortBy;
            args.Update          = update;
            args.Fields          = fields;
            args.Upsert          = upsert;
            args.VersionReturned = returnNew ? FindAndModifyDocumentVersion.Modified : FindAndModifyDocumentVersion.Original;
            var r = _this.FindAndModify(args);

            result = new FindAndModifyUpdateResult(r);
            return(r.GetModifiedDocumentAs(documentType));
        }
Exemplo n.º 2
0
 public object FindAndModifyAs(Type documentType, IMongoQuery query, IMongoSortBy sortBy, IMongoUpdate update, IMongoFields fields, bool returnNew, bool upsert, out UpdateResult result)
 {
     var r = _this.FindAndModify(query, sortBy, update, fields, returnNew, upsert);
     result = new FindAndModifyUpdateResult(r);
     return r.GetModifiedDocumentAs(documentType);
 }
Exemplo n.º 3
0
 public object FindAndModifyAs(Type documentType, IMongoQuery query, IMongoSortBy sortBy, IMongoUpdate update, IMongoFields fields, bool returnNew, bool upsert, out UpdateResult result)
 {
     var args = new FindAndModifyArgs();
     args.Query = query;
     args.SortBy = sortBy;
     args.Update = update;
     args.Fields = fields;
     args.Upsert = upsert;
     args.VersionReturned = returnNew ? FindAndModifyDocumentVersion.Modified : FindAndModifyDocumentVersion.Original;
     var r = _this.FindAndModify(args);
     result = new FindAndModifyUpdateResult(r);
     return r.GetModifiedDocumentAs(documentType);
 }