예제 #1
0
        public Task AddAsync(MagnetMessage message, CancellationToken cancellationToken)
        {
            MessageRecord record = _mapper.Map <MessageRecord>(message);

            _messages.Add(record);
            return(Task.CompletedTask);
        }
예제 #2
0
        public Task AddReadReceiptAsync(MessageReceivedReceipt receipt, CancellationToken cancellationToken)
        {
            MessageRecord msg = _messages.FirstOrDefault(x => x.Id == receipt.MessageId);

            msg.ReceivedLog.Add(new MessageReceivedLog
            {
                ClientName = receipt.ClientName,
                IsMatch    = receipt.IsMatch,
                ReceivedAt = receipt.ReceivedAt
            });
            return(Task.CompletedTask);
        }