DTOMaker.Models 1.6.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package DTOMaker.Models --version 1.6.2
                    
NuGet\Install-Package DTOMaker.Models -Version 1.6.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DTOMaker.Models" Version="1.6.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DTOMaker.Models" Version="1.6.2" />
                    
Directory.Packages.props
<PackageReference Include="DTOMaker.Models" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add DTOMaker.Models --version 1.6.2
                    
#r "nuget: DTOMaker.Models, 1.6.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package DTOMaker.Models@1.6.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=DTOMaker.Models&version=1.6.2
                    
Install as a Cake Addin
#tool nuget:?package=DTOMaker.Models&version=1.6.2
                    
Install as a Cake Tool

DTOMaker

Build-Deploy NuGet Version NuGet Downloads GitHub License GitHub Sponsors

Warning: This is pre-release software under active development. Breaking changes may occur.

Model-driven compile-time source generators for quickly creating polymorphic, freezable DTOs (Data Transport Objects) supporting various serialization protocols:

  • JSON (System.Text.Json)
  • JSON (Newtonsoft.Json)
  • MessagePack 2.x
  • MemBlocks

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

Models are defined as C# interfaces with additional attributes. So let's start with a non-trivial model. Here's how to define a polymorphic, recursive tree type:

using DTOMaker.Models;
using DTOMaker.Runtime;
namespace MyModels;
[Entity(30)] public interface INode : IEntityBase { [Member(1)] String K { get; set; } }
[Entity(31)] public interface IStringNode : INode { [Member(1)] String V { get; set; } }
[Entity(32)] public interface INumberNode : INode { [Member(1)] Int64 V { get; set; } }
[Entity(33)] public interface ITree : IEntityBase
{
    [Member(1)] ITree? L { get; set; }
    [Member(2)] ITree? R { get; set; }
    [Member(3)] INode? N { get; set; }
}

The implmentations will be generated in the MyModels.JsonSystemText namespace.

Development

In progress

  • incremental serialization (MemBlocks)

Coming soon

  • custom type members (to avoid primitive obsession)
  • global interface equality comparer
  • reservation (hidden members)

Coming later

  • MessagePack 3.x serialization
  • Orleans serialization
  • Protobuf.Net serialization
  • generic entities
  • model.json generation
  • command-line alternative
  • variant native type support
  • variable length arrays
  • logical value equality

How to sponsor

If you find these tools useful, please consider sponsoring my work on GitHub at https://github.com/sponsors/Psiman62 or buy me a coffee at https://www.buymeacoffee.com/psiman62

License

This project is licensed under the Apache-2.0 License - see the LICENSE file for details.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

  • net10.0

    • No dependencies.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

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.15-dev 27 3/1/2026
2.0.13-dev 97 2/27/2026
2.0.9-dev 96 2/27/2026
2.0.7-dev 99 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 91 1/17/2026
1.7.1-dev 95 1/8/2026
1.6.2 97 1/3/2026
Loading failed