DTOMaker.Models
2.0.16-dev
See the version list below for details.
dotnet add package DTOMaker.Models --version 2.0.16-dev
NuGet\Install-Package DTOMaker.Models -Version 2.0.16-dev
<PackageReference Include="DTOMaker.Models" Version="2.0.16-dev" />
<PackageVersion Include="DTOMaker.Models" Version="2.0.16-dev" />
<PackageReference Include="DTOMaker.Models" />
paket add DTOMaker.Models --version 2.0.16-dev
#r "nuget: DTOMaker.Models, 2.0.16-dev"
#:package DTOMaker.Models@2.0.16-dev
#addin nuget:?package=DTOMaker.Models&version=2.0.16-dev&prerelease
#tool nuget:?package=DTOMaker.Models&version=2.0.16-dev&prerelease
DTOMaker
Warning: This is pre-release software under active development. Breaking changes may occur.
TLDR
This project contains model-driven compile-time source generators for quickly creating and maintaining polymorphic, immutable DTOs (Data Transport Objects) supporting various serialization protocols.
Open Source Declaration
This is an open source project. This means that you are free to use the source code and released binaries within the terms of the license. Use of such constitutes agreement to the license terms.
This project is maintained by developers who enjoy doing this. Please remember that we are not paid to do this, and that developers are real humans that families, homes, vehicles and other expenses.
If you find this project useful in any way, including generating revenue for your organisation, we ask that you consider sponsoring this project financially. We leave it up to you to decide how much. Any amount is appreciated.
You can contribute via GitHub Sponsors.
Features
- Models defined via C# interfaces with attributes.
- Source generators create implementations at compile time.
- Properties can be basic .NET types such as integers, floats, strings, Guid, etc.
- Raw byte arrays are supported using the built-in Octets type.
- Other common types such as DateTime, DateTimeOffset, TimeSpan are supported by built-in converters.
- User-defined value types can be supported via user-defined converters to built-in types.
- Nullable value types.
- Polymorphic types.
- Freezable types: Instances are mutable until frozen.
- Serialization protocols:
- JSON (System.Text.Json)
- JSON (Newtonsoft.Json)
- MessagePack 2.x
- MemBlocks
- Collections. Collections based on balanced binary trees are supported.
Example
using DTOMaker.Models;
namespace MyModels;
[Entity(1)] public interface INode : IEntityBase
{
[Member(1)] String Key { get; set; }
}
[Entity(2)] public interface IStringNode : INode
{
[Member(1)] String Value { get; set; }
}
[Entity(3)] public interface INumberNode : INode
{
[Member(1)] Int64 Value { get; set; }
}
[Entity(4)] public interface ITree : IEntityBase
{
[Member(1)] ITree? Left { get; set; }
[Member(2)] ITree? Right { get; set; }
[Member(3)] INode? Node { get; set; }
}
Workflow
flowchart TB
def(Define models e.g. IMyDTO.cs)
ref1(Reference DTOMaker.Models)
ref2(Reference runtime e.g. DTOMaker.Runtime.JsonSystemText)
ref3(Reference source generator e.g. DTOMaker.SrcGen.JsonSystemText)
bld(Build/Run)
ref1-->def
def-->ref2
ref2-->ref3
ref3-->bld
Ongoing Development
Coming next in V2.0
- common interface support across all serializers
- BitSet type
Coming later in V2.1+
- ref type converters
- incremental serialization
- MessagePack 3.x serialization
- Orleans serialization
- Protobuf.Net serialization
- model.json generation
- command-line alternative
- variant native type support
- variable length arrays
- logical value equality
- common pattern extensions
License
This project is licensed under the Apache-2.0 License - see the LICENSE file for details.
Miscellaneous
- This readme was last updated 3rd Mar 2026.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- DataFac.Memory (>= 0.20.4)
- System.Memory (>= 4.6.3)
-
net10.0
- DataFac.Memory (>= 0.20.4)
-
net8.0
- DataFac.Memory (>= 0.20.4)
-
net9.0
- DataFac.Memory (>= 0.20.4)
NuGet packages (6)
Showing the top 5 NuGet packages that depend on DTOMaker.Models:
| Package | Downloads |
|---|---|
|
DTOMaker.Runtime.MemBlocks
Runtime types for generated entities |
|
|
DTOMaker.Runtime.JsonNewtonSoft
Runtime types for generated entities |
|
|
DTOMaker.Runtime.JsonSystemText
Runtime types for generated entities |
|
|
DTOMaker.Runtime.MsgPack2
Runtime types for generated entities |
|
|
DTOMaker.Models.BinaryTree
Interface and extension methods for managing binary tree structures. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.0.17-dev | 0 | 3/3/2026 |
| 2.0.16-dev | 0 | 3/3/2026 |
| 2.0.15-dev | 239 | 3/1/2026 |
| 2.0.13-dev | 249 | 2/27/2026 |
| 2.0.9-dev | 249 | 2/27/2026 |
| 2.0.7-dev | 251 | 2/26/2026 |
| 1.11.8-dev | 283 | 2/20/2026 |
| 1.10.4 | 293 | 2/14/2026 |
| 1.9.5 | 319 | 2/7/2026 |
| 1.9.4-dev | 294 | 2/6/2026 |
| 1.9.2-dev | 305 | 2/1/2026 |
| 1.8.7 | 304 | 1/26/2026 |
| 1.8.6 | 289 | 1/23/2026 |
| 1.8.4 | 294 | 1/22/2026 |
| 1.8.1-dev | 291 | 1/22/2026 |
| 1.7.25 | 254 | 1/19/2026 |
| 1.7.22 | 252 | 1/18/2026 |
| 1.7.20-dev | 247 | 1/18/2026 |
| 1.7.18-dev | 87 | 1/18/2026 |
| 1.7.8-dev | 92 | 1/17/2026 |