Managing models
The first part of this chapter is all about managing models. Models are the templates for Azure Digital Twins. We will be exploring how to create, inherit, delete, and get a Model by using the .NET SDK.
Creating a model
Let's start by creating a model for a Room. We need to create a folder called Models
under the SmartBuildingConsoleApp
node in the Solution Explorer. Follow these steps:
- Right-click on the SmartBuildingConsoleApp node and select Add | New Folder
- Name the folder Models
- Right-click on the Models folder and select Add|New folder
- Name the folder chapter4
- Right-click on the chapter4 folder and select Add|New Item
- Look for a JSON file type
- Name the file room.json.
Replace the contents of the room.json
file with the following code:
{ "@id": "dtmi:com:smartbuilding:Room;1", "@type": "Interface", "@context": "dtmi:dtdl...