Atc.SourceGenerators 0.1.66

dotnet add package Atc.SourceGenerators --version 0.1.66
                    
NuGet\Install-Package Atc.SourceGenerators -Version 0.1.66
                    
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="Atc.SourceGenerators" Version="0.1.66">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Atc.SourceGenerators" Version="0.1.66" />
                    
Directory.Packages.props
<PackageReference Include="Atc.SourceGenerators">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
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 Atc.SourceGenerators --version 0.1.66
                    
#r "nuget: Atc.SourceGenerators, 0.1.66"
                    
#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 Atc.SourceGenerators@0.1.66
                    
#: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=Atc.SourceGenerators&version=0.1.66
                    
Install as a Cake Addin
#tool nuget:?package=Atc.SourceGenerators&version=0.1.66
                    
Install as a Cake Tool

🎯 Atc Source Generators

A collection of Roslyn C# source generators for .NET that eliminate boilerplate code and improve developer productivity. All generators are designed with Native AOT compatibility in focus, enabling faster startup times, smaller deployment sizes, and optimal performance for modern cloud-native applications.

Why Choose Atc Source Generators?

  • 🎯 Zero boilerplate - Attribute-based approach eliminates repetitive code
  • ⚑ Compile-time generation - Catch errors during build, not at runtime
  • πŸš€ Native AOT ready - Zero reflection, fully trimming-safe for modern .NET
  • 🧩 Multi-project architecture - Smart naming for clean layered applications
  • πŸ›‘οΈ Type-safe - Full IntelliSense and compile-time validation
  • πŸ“¦ Single package - Install once, use all generators

πŸš€ Source Generators

Generator Attribute What It Does
⚑ DependencyRegistration [Registration] Automatic DI service registration with auto-detection, keyed services, factories, decorators
βš™οΈ OptionsBinding [OptionsBinding] Configuration binding with validation, change callbacks, named options
πŸ—ΊοΈ ObjectMapping [MapTo(typeof(T))] Object-to-object mapping with bidirectional, nested, and collection support
πŸ”„ EnumMapping [MapTo(typeof(T))] Enum-to-enum mapping with special case detection (None ↔ Unknown)
πŸ“‹ AnnotationConstants (automatic) Compile-time access to DataAnnotation metadata without reflection

✨ See It In Action

All generators work together seamlessly in a typical 3-layer architecture:

// 1️⃣ Domain Layer - Your business logic
[MapTo(typeof(PetStatusDto), Bidirectional = true)]
public enum PetStatus { Available, Adopted }

[MapTo(typeof(PetDto))]
public partial class Pet
{
    public Guid Id { get; set; }
    public string Name { get; set; } = string.Empty;
    public PetStatus Status { get; set; }
}

[Registration(Lifetime.Scoped)]
public class PetService : IPetService
{
    public async Task<Pet> GetPetAsync(Guid id) { /* ... */ }
}

[OptionsBinding("PetStore")]
public partial class PetStoreOptions
{
    [Required] public int MaxPetsPerPage { get; set; }
}

// 2️⃣ Program.cs - One line per concern
using Atc.DependencyInjection;
using Atc.Mapping;

builder.Services.AddDependencyRegistrationsFromDomain();
builder.Services.AddOptionsFromDomain(builder.Configuration);

// 3️⃣ Usage - Clean and type-safe
app.MapGet("/pets/{id}", async (Guid id, IPetService service) =>
{
    var pet = await service.GetPetAsync(id);
    return Results.Ok(pet.MapToPetDto());  // ✨ Generated mapping
});

Result: Zero boilerplate, full type safety, Native AOT ready! πŸš€

πŸ“¦ Installation

dotnet add package Atc.SourceGenerators

Optional (recommended for better IntelliSense):

dotnet add package Atc.SourceGenerators.Annotations

βš™οΈ Requirements

  • .NET 10 SDK required at build time (Roslyn 5.0.0)
  • Projects can still target .NET 9, .NET 8, or earlier
  • This is a build-time requirement only, not a runtime requirement

πŸ“– Documentation

Full documentation is available in the Wiki:

Page Description
Getting Started Installation, packages, and SDK requirements
Dependency Registration Automatic DI with [Registration] β€” auto-detection, keyed services, factories, decorators, transitive registration
Options Binding Configuration binding with [OptionsBinding] β€” validation, change callbacks, named options, child sections
Object Mapping Object mapping with [MapTo] β€” bidirectional, nested objects, collections, projections, property strategies
Enum Mapping Enum mapping with [MapTo] β€” special case detection, bidirectional, case-insensitive
Annotation Constants Compile-time DataAnnotation metadata β€” zero reflection, Blazor-ready, Native AOT
Sample Projects Working code examples for each generator
PetStore API Example Full application using all generators with OpenAPI/Scalar

πŸ”¨ Building

dotnet build

πŸ§ͺ Testing

dotnet test

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

πŸ“„ License

[License information here]

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 was computed.  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 was computed.  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 was computed.  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

    • No dependencies.

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
0.1.66 323 3/14/2026
0.1.65 130 3/13/2026
0.1.56 129 3/13/2026
0.1.49 302 12/19/2025
0.1.48 245 12/4/2025
0.1.47 444 11/20/2025
0.1.46 437 11/19/2025
0.1.44 450 11/19/2025
0.1.5 324 11/17/2025
0.1.2 329 11/16/2025