Last active
April 20, 2018 18:36
-
-
Save melzoghbi/b8fc16593048e1959e6459c78c3581a6 to your computer and use it in GitHub Desktop.
Sample File
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static Task onDesiredPropertiesUpdate(TwinCollection desiredProperties, object userContext) | |
{ | |
try | |
{ | |
Console.WriteLine("Desired property change:"); | |
Console.WriteLine(JsonConvert.SerializeObject(desiredProperties)); | |
if (desiredProperties["TemperatureThreshold"]!=null) | |
temperatureThreshold = desiredProperties["TemperatureThreshold"]; | |
} | |
catch (AggregateException ex) | |
{ | |
foreach (Exception exception in ex.InnerExceptions) | |
{ | |
Console.WriteLine(); | |
Console.WriteLine("Error when receiving desired property: {0}", exception); | |
} | |
} | |
catch (Exception ex) | |
{ | |
Console.WriteLine(); | |
Console.WriteLine("Error when receiving desired property: {0}", ex.Message); | |
} | |
return Task.CompletedTask; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment