DTOMaker.Runtime.MemBlocks
2.0.54
dotnet add package DTOMaker.Runtime.MemBlocks --version 2.0.54
NuGet\Install-Package DTOMaker.Runtime.MemBlocks -Version 2.0.54
<PackageReference Include="DTOMaker.Runtime.MemBlocks" Version="2.0.54" />
<PackageVersion Include="DTOMaker.Runtime.MemBlocks" Version="2.0.54" />
<PackageReference Include="DTOMaker.Runtime.MemBlocks" />
paket add DTOMaker.Runtime.MemBlocks --version 2.0.54
#r "nuget: DTOMaker.Runtime.MemBlocks, 2.0.54"
#:package DTOMaker.Runtime.MemBlocks@2.0.54
#addin nuget:?package=DTOMaker.Runtime.MemBlocks&version=2.0.54
#tool nuget:?package=DTOMaker.Runtime.MemBlocks&version=2.0.54
DTOMaker
This repo contains model-driven compile-time source generators for quickly creating and maintaining polymorphic, immutable DTOs (Data Transport Objects) supporting various serialization protocols.
The objective of these generators is to improve developer productivity, saving time and reducing errors incurred maintaining boilerplate DTO code, by allowing developers to focus on the more interesting data model design, rather than on coding the implementations.
Features
All DTOs created by these generators support the following features:
- Common interfaces: Models are defined as C# interfaces. As each implementation has constructors that accept these interfaces, different implementations can be used interchangeably, allowing simple conversion between different serialization formats.
- Immutability/Freezability: Newly created instances are mutable until frozen. Once frozen, instances become immutable and can be safely shared across threads without locking.
- Backward compatibility: New properties can be added to models without breaking backward compatibility. Older versions of the DTOs will simply ignore new properties.
- Polymorphism: Model types are defined as interfaces that can inherit from other interfaces. This allows for polymorphic types, where a property of a base type can hold instances of derived types.
- Incremental serialization: When serializing an object graph, only the parts of the graph that have changed since the last serialization need to be re-serialized. This can significantly improve performance when working with large object graphs where only a small portion of the data changes between serializations. [Note: Currently, this feature is only supported by the MemBlox2 generator.]
- Built-in type support: Most .NET primitive types are supported out of the box, including 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. All types can be nullable.
- Custom type support: User-defined value types can be supported via user-defined converters to built-in types. For example, a custom type representing a 3D point could be converted to and from a built-in type such as a tuple of three floats.
- Collections: Currently, only collections based on balanced binary trees are supported. [Development is ongoing.]
Serialization Protocols
The following serialization protocols are supported via separate source generators and runtime libraries. You can choose which ones to use by referencing the appropriate source generator and runtime library in your project.
- JSON (System.Text.Json)
- JSON (Newtonsoft.Json)
- MessagePack 2.x
- MemBlox2 (a custom binary format optimised for incremental serialization)
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
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 unpaid developers who enjoy doing this. Please remember that developers are ordinary people, probably much like you, that have families, homes, vehicles and other everyday 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.
Coming next in V2.1
- BitSet type
Coming later
- ref type converters
- incremental serialization for all
- more collection types
- MessagePack 3.x serialization
- Orleans serialization
- Protobuf.Net serialization
- model.json generation
- command-line alternative
- logical value equality
License
This project is licensed under the Apache-2.0 License - see the LICENSE file for details.
Miscellaneous
- This readme was last updated 15th May 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.MemBlox2 (>= 2.0.54)
- DataFac.Memory (>= 1.0.7)
- DataFac.Storage (>= 3.0.26)
- DTOMaker.Models (>= 2.0.54)
- DTOMaker.Runtime (>= 2.0.54)
- Microsoft.Bcl.HashCode (>= 6.0.0)
- System.Memory (>= 4.6.3)
- System.Threading.Tasks.Extensions (>= 4.6.3)
-
net10.0
- DataFac.MemBlox2 (>= 2.0.54)
- DataFac.Memory (>= 1.0.7)
- DataFac.Storage (>= 3.0.26)
- DTOMaker.Models (>= 2.0.54)
- DTOMaker.Runtime (>= 2.0.54)
- Microsoft.Bcl.HashCode (>= 6.0.0)
-
net8.0
- DataFac.MemBlox2 (>= 2.0.54)
- DataFac.Memory (>= 1.0.7)
- DataFac.Storage (>= 3.0.26)
- DTOMaker.Models (>= 2.0.54)
- DTOMaker.Runtime (>= 2.0.54)
- Microsoft.Bcl.HashCode (>= 6.0.0)
-
net9.0
- DataFac.MemBlox2 (>= 2.0.54)
- DataFac.Memory (>= 1.0.7)
- DataFac.Storage (>= 3.0.26)
- DTOMaker.Models (>= 2.0.54)
- DTOMaker.Runtime (>= 2.0.54)
- Microsoft.Bcl.HashCode (>= 6.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.0.54 | 0 | 5/16/2026 |
| 2.0.52 | 34 | 5/15/2026 |
| 2.0.50 | 95 | 5/4/2026 |
| 2.0.49 | 105 | 4/26/2026 |
| 2.0.48 | 101 | 4/25/2026 |
| 2.0.46-dev | 89 | 4/25/2026 |
| 2.0.45-dev | 95 | 4/16/2026 |
| 2.0.39-dev | 99 | 4/2/2026 |
| 2.0.38-dev | 102 | 3/31/2026 |
| 2.0.36-dev | 101 | 3/31/2026 |
| 2.0.29-dev | 99 | 3/17/2026 |
| 2.0.28-dev | 115 | 3/17/2026 |
| 2.0.26-dev | 119 | 3/15/2026 |
| 2.0.25-dev | 120 | 3/12/2026 |
| 2.0.24-dev | 98 | 3/7/2026 |
| 2.0.23-dev | 91 | 3/7/2026 |
| 2.0.20-dev | 99 | 3/5/2026 |
| 2.0.19-dev | 97 | 3/5/2026 |
| 2.0.18-dev | 99 | 3/5/2026 |
| 2.0.17-dev | 101 | 3/3/2026 |