Skip to content

Nextended.AutoDto ​

Automatic DTO generation support library for Nextended.CodeGen.

Overview ​

Nextended.AutoDto provides infrastructure and support for automatic Data Transfer Object (DTO) generation. It works in conjunction with Nextended.CodeGen to provide attribute-based DTO generation.

Installation ​

bash
dotnet add package Nextended.AutoDto
dotnet add package Nextended.CodeGen

Purpose ​

This package provides:

  • DTO generation infrastructure
  • Attribute support for DTO configuration
  • Integration with Nextended.CodeGen source generator

Usage ​

Nextended.AutoDto is typically used as a dependency of Nextended.CodeGen. For comprehensive usage examples and documentation, please refer to:

Basic Example ​

csharp
using Nextended.Core.Attributes;

[AutoGenerateDto]
public class User
{
    public int Id { get; set; }
    public string Name { get; set; }
    public string Email { get; set; }
}

// After build, you can use:
var user = new User { Id = 1, Name = "John" };
var dto = user.ToDto();

Supported Frameworks ​

  • .NET Standard 2.0

Dependencies ​

  • Roslyn APIs for source generation
  • Nextended.Core for attributes