private async Task SendDataAsync(CoffeeMachineData coffeeMachineData) { try { await _dataSender.SendDataAsync(coffeeMachineData); WriteLog($"Send data: {coffeeMachineData.ToString()}"); } catch (Exception ex) { WriteLog(ex.Message); } }
private async Task SendDataAsync(CoffeeMachineData coffeeMachineData) { try { string jsonData = JsonConvert.SerializeObject(coffeeMachineData); byte[] data = Encoding.UTF8.GetBytes(jsonData); await _eventSender.SendDataAsync(data); LogMessage($"Sent Data{coffeeMachineData.ToString()}"); } catch (Exception ex) { LogMessage(ex.Message); } }