private static ImportantMeasure CreateImportantMeasure(int degree) { var radian = Math.PI / 180 * degree; var newValue = MAX_VALUE * Math.Sin(radian); var measure = new ImportantMeasure { ImportantValue = newValue }; return measure; }
private static void SendImportantMeasureToEventHub(ImportantMeasure measure) { var eventData = new EventData(measure.AsByteArray()); try { _eventHubClient.Send(eventData); } catch (Exception ex) { Trace.WriteLine($"ERROR SENDING: {ex.Message}\n\n{ex.StackTrace.ToString()}"); throw; } }