private Task <WriteConcernResult> ExecuteProtocolAsync(IChannelHandle channel, CancellationToken cancellationToken) { if (_request.Collation != null) { throw new NotSupportedException("OP_UPDATE does not support collations."); } if (_request.ArrayFilters != null) { throw new NotSupportedException("OP_UPDATE does not support arrayFilters."); } if (_request.Hint != null) { throw new NotSupportedException("OP_UPDATE does not support hints."); } return(channel.UpdateAsync( _collectionNamespace, _messageEncoderSettings, _writeConcern, _request.Filter, _request.Update.AsBsonDocument, ElementNameValidatorFactory.ForUpdateType(_request.UpdateType), _request.IsMulti, _request.IsUpsert, cancellationToken)); }
// methods private Task <WriteConcernResult> ExecuteProtocolAsync(IChannelHandle channel, CancellationToken cancellationToken) { return(channel.UpdateAsync( _collectionNamespace, _messageEncoderSettings, _writeConcern, _request.Filter, _request.Update, ElementNameValidatorFactory.ForUpdateType(_request.UpdateType), _request.IsMulti, _request.IsUpsert, cancellationToken)); }
// methods protected override Task <WriteConcernResult> ExecuteProtocolAsync(IChannelHandle channel, WriteRequest request, CancellationToken cancellationToken) { var updateRequest = (UpdateRequest)request; return(channel.UpdateAsync( CollectionNamespace, MessageEncoderSettings, WriteConcern, updateRequest.Filter, updateRequest.Update, ElementNameValidatorFactory.ForUpdateType(updateRequest.UpdateType), updateRequest.IsMulti, updateRequest.IsUpsert, cancellationToken)); }
protected override Task<WriteConcernResult> ExecuteProtocolAsync(IChannelHandle channel, WriteRequest request, CancellationToken cancellationToken) { var updateRequest = (UpdateRequest)request; return channel.UpdateAsync( CollectionNamespace, MessageEncoderSettings, WriteConcern, updateRequest.Filter, updateRequest.Update, ElementNameValidatorFactory.ForUpdateType(updateRequest.UpdateType), updateRequest.IsMulti, updateRequest.IsUpsert, cancellationToken); }
protected override Task<WriteConcernResult> ExecuteProtocolAsync(IChannelHandle channel, WriteRequest request, CancellationToken cancellationToken) { var updateRequest = (UpdateRequest)request; if (updateRequest.Collation != null) { throw new NotSupportedException("BulkUpdateOperationEmulator does not support collations."); } return channel.UpdateAsync( CollectionNamespace, MessageEncoderSettings, WriteConcern, updateRequest.Filter, updateRequest.Update, ElementNameValidatorFactory.ForUpdateType(updateRequest.UpdateType), updateRequest.IsMulti, updateRequest.IsUpsert, cancellationToken); }
protected override Task <WriteConcernResult> ExecuteProtocolAsync(IChannelHandle channel, WriteRequest request, CancellationToken cancellationToken) { var updateRequest = (UpdateRequest)request; if (updateRequest.Collation != null) { throw new NotSupportedException("BulkUpdateOperationEmulator does not support collations."); } return(channel.UpdateAsync( CollectionNamespace, MessageEncoderSettings, WriteConcern, updateRequest.Filter, updateRequest.Update, ElementNameValidatorFactory.ForUpdateType(updateRequest.UpdateType), updateRequest.IsMulti, updateRequest.IsUpsert, cancellationToken)); }