public async ValueTask Publish(IServiceBusMessage message) { await _sender.SendMessageAsync(new ServiceBusMessage { Body = BinaryData.FromStream(message.GetStream()) }); }
public T Deserialize <T>(IServiceBusMessage message) { using var stream = message.GetStream(); using var reader = new StreamReader(stream); using var json = new JsonTextReader(reader); var consumerMessage = _serializer.Deserialize <T>(json); return(consumerMessage); }