DTOMaker.Models 1.8.7

dotnet add package DTOMaker.Models --version 1.8.7
                    
NuGet\Install-Package DTOMaker.Models -Version 1.8.7
                    
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.8.7" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DTOMaker.Models" Version="1.8.7" />
                    
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.8.7
                    
#r "nuget: DTOMaker.Models, 1.8.7"
                    
#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.8.7
                    
#: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.8.7
                    
Install as a Cake Addin
#tool nuget:?package=DTOMaker.Models&version=1.8.7
                    
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.

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.
    • 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 types.
  • Polymorphic types.
  • Freezability: DTO instances are mutable until frozen, after which they become immutable.
  • Serialization protocols:
    • JSON via System.Text.Json
    • JSON via 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

Development

Coming soon

  • more custom (ref and value) type converters

Coming later

  • 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

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.

NuGet packages (5)

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
1.8.7 279 1/26/2026
1.8.6 275 1/23/2026
1.8.4 283 1/22/2026
1.8.1-dev 280 1/22/2026
1.7.25 245 1/19/2026
1.7.22 243 1/18/2026
1.7.20-dev 240 1/18/2026
1.7.18-dev 80 1/18/2026
1.7.8-dev 84 1/17/2026
1.7.1-dev 87 1/8/2026
1.6.12 95 1/6/2026
1.6.10 90 1/4/2026
1.6.2 87 1/3/2026
1.6.1 92 1/3/2026
1.5.23 90 1/1/2026
1.5.22-dev 91 1/1/2026
1.5.19-dev 81 1/1/2026
1.5.18-dev 88 12/28/2025
1.5.13-dev 84 12/27/2025
1.5.4-dev 130 12/26/2025
1.4.17 163 12/26/2025
1.4.16 177 12/25/2025
1.4.10 176 12/24/2025
1.4.8 176 12/24/2025
1.4.7-dev 171 12/23/2025
1.4.4-dev 163 12/22/2025
1.3.6 140 12/20/2025
1.3.5-dev 122 12/20/2025
1.3.4-dev 137 12/20/2025
1.3.3-dev 229 12/19/2025
1.2.11 258 12/17/2025
1.2.10 261 12/17/2025
1.2.9 266 12/17/2025
1.2.8-dev 268 12/17/2025
1.2.7-dev 266 12/17/2025
1.2.6-dev 260 12/17/2025
1.2.5-dev 255 12/17/2025
1.2.4-dev 267 12/17/2025
0.72.6 195 11/27/2025
0.72.5 348 11/17/2025
0.72.4 285 11/13/2025
0.72.3 284 11/13/2025
0.71.12 159 10/10/2025
0.71.11 172 10/3/2025
0.71.9 305 9/19/2025
0.71.8 329 9/17/2025
0.71.7 332 9/16/2025
0.71.5 273 9/15/2025
0.71.3 259 9/15/2025
0.71.1 273 9/15/2025
0.70.3 197 9/9/2025
0.70.2 202 9/2/2025
0.70.1-dev 228 8/27/2025
0.69.10 163 8/17/2025
0.69.9 123 8/16/2025
0.69.8 199 8/13/2025
0.69.7-dev 188 8/13/2025
0.69.6-dev 182 8/12/2025
0.69.4-dev 155 8/9/2025
0.69.3-dev 108 7/19/2025
0.69.2-dev 102 7/19/2025
0.68.6 108 7/19/2025
0.68.5-dev 111 7/19/2025
0.68.2-dev 187 7/17/2025
0.68.1-dev 178 7/17/2025
0.67.7 185 7/17/2025
0.67.6-dev 188 7/9/2025
0.67.5-dev 178 7/9/2025
0.67.3-dev 189 7/7/2025
0.67.1-dev 333 6/10/2025
0.66.18 291 6/9/2025
0.66.17-dev 261 6/9/2025
0.66.16-dev 162 6/8/2025
0.66.14-dev 128 6/7/2025
0.66.13-dev 185 6/5/2025
0.66.10-dev 194 6/5/2025
0.66.9-dev 183 6/5/2025
0.66.8-dev 187 6/5/2025
0.66.7-dev 181 6/4/2025
0.66.2-dev 105 5/31/2025
0.65.20-generics-g24a665d336 111 5/31/2025
0.65.13-generics-ge74b19332f 207 4/23/2025
0.65.10-generics-g6f262eb134 258 4/17/2025
0.65.1-generics 106 5/31/2025
0.64.27 197 5/27/2025
0.64.26 256 5/16/2025
0.64.24 192 5/8/2025
0.64.22 213 4/23/2025
0.64.20 221 4/10/2025
0.64.18 211 4/10/2025
0.64.17 211 4/10/2025
0.64.16 202 4/9/2025
0.64.10 218 4/7/2025
0.64.9 170 4/4/2025
0.64.8-dev 194 4/1/2025
0.64.7-dev-g53a80ba3be 185 4/1/2025
0.64.5-dev-g449e36f771 511 3/25/2025
0.64.5-dev-g2fcf9bff64 195 4/1/2025
0.64.4-dev 192 4/1/2025
0.64.3-dev 190 3/31/2025
0.64.2-dev 510 3/25/2025
0.64.1-dev 511 3/25/2025
0.63.60-gee4d301e03 516 3/25/2025
0.63.19 160 3/21/2025
0.63.19-g2e909c64aa 143 3/21/2025
0.63.17 169 3/14/2025
0.63.16 165 3/14/2025
0.63.15 196 3/13/2025
0.63.13 225 3/11/2025
0.63.12 212 3/11/2025
0.63.11-dev 216 3/11/2025
0.63.9-dev 204 3/11/2025
0.63.8-dev 205 3/10/2025
0.63.7-dev 208 3/10/2025
0.63.6-dev 209 3/10/2025
0.63.3-dev 198 3/10/2025
0.62.10 274 3/8/2025
0.62.9 268 3/8/2025
0.62.7 263 3/7/2025
0.62.6-dev 252 3/7/2025
0.62.5-dev 246 3/7/2025
0.61.14 270 3/6/2025
0.61.13-dev 257 3/6/2025
0.61.12-dev 259 3/6/2025
0.61.10-dev 243 3/6/2025
0.61.9-dev 244 3/5/2025
0.61.8-dev 246 3/5/2025
0.61.5-dev 245 3/4/2025
0.61.3-dev 253 3/4/2025
0.61.2-dev 182 3/3/2025
0.60.8 179 2/27/2025
0.60.7 151 2/27/2025
0.60.6-dev 136 2/27/2025
0.60.3-dev 134 2/25/2025
0.59.10 165 2/19/2025
0.59.8-dev 131 2/19/2025
0.59.5-dev 143 2/17/2025
0.59.4-dev 146 2/15/2025
0.58.9 167 2/4/2025
0.58.8-dev 142 2/4/2025
0.57.6 167 2/1/2025
0.57.4 158 2/1/2025
0.57.2-dev 140 2/1/2025
0.57.1-dev 141 2/1/2025
0.56.13 159 1/31/2025
0.56.12-dev 140 1/31/2025
0.56.11-dev 137 1/30/2025
0.56.10-dev 140 1/30/2025
0.56.9-dev 137 1/30/2025
0.56.6-dev 126 1/24/2025
0.56.5-dev 126 1/24/2025
0.56.4-dev 126 1/24/2025
0.56.3-dev 122 1/24/2025
0.55.38 148 1/23/2025
0.55.37-dev 133 1/23/2025
0.55.36-dev 133 1/22/2025
0.55.34-dev 122 1/22/2025
0.55.32-dev 115 1/22/2025
0.55.31-dev 137 1/21/2025
0.55.30-dev 131 1/21/2025
0.55.29-dev 131 1/20/2025
0.55.27-dev 129 1/20/2025
0.55.25-dev 124 1/20/2025
0.55.24-dev 136 1/20/2025
0.55.23-dev 131 1/19/2025
0.55.20-dev 124 1/19/2025
0.55.17-dev 124 1/19/2025
0.55.14-dev 130 1/19/2025
0.55.3-dev 135 1/9/2025
0.55.2-dev 108 1/9/2025
0.54.2 159 1/3/2025
0.54.1-dev 132 1/3/2025
0.53.3 163 1/1/2025
0.53.2 174 12/31/2024
0.53.1-dev 140 12/31/2024
0.51.2 167 12/31/2024
0.51.1 145 12/31/2024
0.50.3 156 12/31/2024
0.50.2-dev 135 12/31/2024
0.50.1-dev 127 12/31/2024
0.49.7 153 12/31/2024
0.49.6 153 12/29/2024
0.49.5-dev 130 12/29/2024
0.49.4-dev 131 12/29/2024
0.48.5 146 12/29/2024
0.48.4-dev 139 12/28/2024
0.48.3-dev 134 12/28/2024
0.48.2-dev 137 12/28/2024
0.48.1-dev 137 12/28/2024
0.47.1 150 12/27/2024
0.46.9 155 12/27/2024
0.46.8 158 12/27/2024
0.46.7 149 12/27/2024
0.46.6 154 12/23/2024
0.46.5 159 12/23/2024
0.46.4 151 12/22/2024
0.46.3 150 12/22/2024
0.46.2-dev 132 12/22/2024
0.46.1-dev 139 12/22/2024
0.45.4 148 12/21/2024
0.45.3-dev 140 12/20/2024
0.45.2-dev 129 12/20/2024
0.44.4 154 12/19/2024
0.44.3 145 12/19/2024
0.44.2 147 12/19/2024
0.44.1 136 12/19/2024
0.43.5 142 12/19/2024
0.43.4 143 12/19/2024
0.43.3 154 12/19/2024
0.43.2-dev 145 12/19/2024
0.43.1-dev 141 12/18/2024
0.42.2 156 12/18/2024
0.42.1-dev 133 12/18/2024
0.41.6 157 12/18/2024
0.41.5-dev 141 12/18/2024
0.40.16 144 12/17/2024
0.40.14 146 12/16/2024
0.40.12-dev 140 12/16/2024
0.40.3-dev 135 12/3/2024
0.40.1-dev 137 12/3/2024
0.39.2 147 12/3/2024
0.39.1-dev 128 12/2/2024
0.38.4 149 11/30/2024
0.38.3-dev 129 11/30/2024
0.38.2-dev 141 11/30/2024
0.38.1-dev 131 11/25/2024
0.37.3 154 11/24/2024
0.37.2 159 11/23/2024
0.37.1 152 11/23/2024
0.36.6 153 11/23/2024
0.36.5 161 11/22/2024
0.36.4 142 11/22/2024
0.36.2 151 11/20/2024
0.34.1 150 11/17/2024