public async Task <TValue> TryUpdateAsync(TKey key, TValue newValue)
        {
            var(keyData, valueData) = ToSafeData(key, newValue);

            var requestMessage  = TransactionalMapReplaceCodec.EncodeRequest(Name, TransactionId, ContextId, keyData, valueData);
            var responseMessage = await Cluster.Messaging.SendToMemberAsync(requestMessage, TransactionClientConnection).CAF();

            var response = TransactionalMapReplaceCodec.DecodeResponse(responseMessage).Response;

            return(ToObject <TValue>(response));
        }
        public virtual TValue Replace(TKey key, TValue value)
        {
            var keyData   = ToData(key);
            var valueData = ToData(value);

            var request = TransactionalMapReplaceCodec.EncodeRequest(GetName(), GetTransactionId(), GetThreadId(),
                                                                     keyData, valueData);
            var result = Invoke(request, m => TransactionalMapReplaceCodec.DecodeResponse(m).response);

            return(ToObject <TValue>(result));
        }