Runtime types for generated entities
$ dotnet add package DTOMaker.Runtime![]()
Warning: This is pre-release software under active development. Breaking changes may occur.
This project 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.
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.
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; }
}
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
This project is licensed under the Apache-2.0 License - see the LICENSE file for details.