-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix digital twins samples #16118
Fix digital twins samples #16118
Conversation
string sampleFloorModelId = "dtmi:com:samples:SampleFloor;1"; | ||
try | ||
{ | ||
Console.WriteLine($"Deleting model Id '{sampleBuildingModelId}' if it exists."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the sample runs once but fails to cleanup, we need to make sure that these model Ids are available to create upon any subsequent runs
Console.WriteLine($"Deleting model Id '{sampleBuildingModelId}' if it exists."); | ||
await client.DeleteModelAsync(sampleBuildingModelId); | ||
} | ||
catch (Exception ex) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't need ex
if unused.
// Model did not exist yet, and that's fine | ||
} | ||
|
||
try |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think this would read better if this try/catch block was a helper method?
It seems to me it isn't central to the reading of the sample, but more about smooth operation of a sample.
No description provided.