public async Task Send(MessageModel message) { var queue = await queueRetriever.GetQueue(); var json = JsonConvert.SerializeObject(message); await queue.SendMessageAsync(json); }
public async Task <MessageModel> Receive() { QueueClient queue = await queueRetriever.GetQueue(); bool exists = await queue.ExistsAsync(); if (exists) { var message = await queue.ReceiveMessageAsync(); if (message.Value != null) { var result = message.Value.Body.ToObjectFromJson <MessageModel>(); await queue.DeleteMessageAsync(message.Value.MessageId, message.Value.PopReceipt); return(result); } } return(null); }