private static EventData CreateEventData(SweetsMachineData data) { var dataAsJson = JsonConvert.SerializeObject(data); var eventData = new EventData(Encoding.UTF8.GetBytes(dataAsJson)); return(eventData); }
public async Task SendDataAsync(SweetsMachineData sweetsMachineEvent) { EventData eventData = CreateEventData(sweetsMachineEvent); await _eventHubClient.SendAsync(eventData); }