public Task EnqueueAsync(Message msg)
        {
            var dto = new AdoNetMessageDto(null, msg, _messageSerializer);

            _messageSerializer.Serialize(dto, out var json, out var contentType);

            InsertMessage(json, contentType);

            return(Task.FromResult <object>(null));
        }
 public Task EnqueueAsync(ClaimsPrincipal user, IReadOnlyCollection <Message> messages)
 {
     foreach (var msg in messages)
     {
         var dto = new AdoNetMessageDto(user, msg, _messageSerializer);
         _messageSerializer.Serialize(dto, out var json, out var contentType);
         InsertMessage(json, contentType);
     }
     return(Task.FromResult <object>(null));
 }