Example #1
0
        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;
        }
Example #2
0
        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;
            }
        }