![]() |
VOOZH | about |
dotnet add package Microsoft.DigitalWorkplace.DigitalTwins.Models.Generator --version 1.0.1
NuGet\Install-Package Microsoft.DigitalWorkplace.DigitalTwins.Models.Generator -Version 1.0.1
<PackageReference Include="Microsoft.DigitalWorkplace.DigitalTwins.Models.Generator" Version="1.0.1" />
<PackageVersion Include="Microsoft.DigitalWorkplace.DigitalTwins.Models.Generator" Version="1.0.1" />Directory.Packages.props
<PackageReference Include="Microsoft.DigitalWorkplace.DigitalTwins.Models.Generator" />Project file
paket add Microsoft.DigitalWorkplace.DigitalTwins.Models.Generator --version 1.0.1
#r "nuget: Microsoft.DigitalWorkplace.DigitalTwins.Models.Generator, 1.0.1"
#:package Microsoft.DigitalWorkplace.DigitalTwins.Models.Generator@1.0.1
#addin nuget:?package=Microsoft.DigitalWorkplace.DigitalTwins.Models.Generator&version=1.0.1Install as a Cake Addin
#tool nuget:?package=Microsoft.DigitalWorkplace.DigitalTwins.Models.Generator&version=1.0.1Install as a Cake Tool
This Digital Twin Definition Language (DTDL) Model Generator parses your DTDL json files and generates C# POCO classes to be used when interacting with the Azure Digital Twins SDK. This is made possible because all of the generated model classes inherit from the ADT-provided BasicDigitalTwin class.
The following are some prerequisites/assumptions to be considered:
| Content | DTDL v2 | Model Generator |
|---|---|---|
| Telemetry | ✅ | ❌ |
| Property | ✅ | ✅ |
| Command | ✅ | ✅ |
| Relationship | ✅ | ✅ |
| Component | ✅ | ❌ |
| Schemas | DTDL v2 | Model Generator |
|---|---|---|
| Boolean | ✅ | ✅ |
| Date | ✅ | ✅ |
| DateTime | ✅ | ✅ |
| Double | ✅ | ✅ |
| Duration | ✅ | ✅ |
| Float | ✅ | ✅ |
| Integer | ✅ | ✅ |
| Long | ✅ | ❌ |
| String | ✅ | ✅ |
| Time | ✅ | ✅ |
| Array (Property) | ❌ | ❌ |
| Array (Telemetry) | ✅ | ❌ |
| Enum | ✅ | ✅ |
| Map | ✅ | ✅ |
| Object | ✅ | ✅ |
| Semantic Type (Property) | ✅ | ✅ |
| Semantic Type (Telemetry) | ✅ | ❌ |
using Microsoft.DigitalWorkplace.DigitalTwins.Models.Generator;
//...
var currentDir = Directory.GetCurrentDirectory();
var jsonDir = Path.Combine(currentDir, "TestDtdlModels");
var options = new ModelGeneratorOptions
{
OutputDirectory = Path.Combine(currentDir, "..", "..", "..", "..", "Generator.Tests.Generated"),
Namespace = "Generator.Tests.Generated",
JsonModelsDirectory = jsonDir
};
var generator = new ModelGenerator(options);
await generator.GenerateClassesAsync();
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit the Microsoft Contributor License Agreements page.
When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact with any additional questions or comments.
For guidance on reporting security issues, please refer to the section.
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 net6.0 is compatible. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.1 | 1,626 | 8/31/2023 |
| 0.2.1-test5 | 268 | 8/30/2023 |
| 0.2.1-test4 | 228 | 8/30/2023 |
| 0.2.1-test3 | 222 | 8/30/2023 |
| 0.2.0 | 2,317 | 9/15/2022 |
| 0.1.1 | 1,094 | 6/22/2022 |
| 0.1.0 | 662 | 6/7/2022 |