From 24fe289689be91dfd4bad85cdaa520aaeeae555f Mon Sep 17 00:00:00 2001 From: davidkallesen Date: Sun, 16 Nov 2025 23:53:02 +0100 Subject: [PATCH] docs: update reambe with Installation section --- README.md | 137 ++++++++++++------------------------------------------ 1 file changed, 30 insertions(+), 107 deletions(-) diff --git a/README.md b/README.md index 6b33d8a..9f6aebe 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # 🎯 Atc Source Generators -A collection of Roslyn C# source generators for .NET that eliminate boilerplate code and improve developer productivity. +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. ## πŸš€ Source Generators @@ -9,6 +9,34 @@ A collection of Roslyn C# source generators for .NET that eliminate boilerplate - **[πŸ—ΊοΈ MappingGenerator](#️-mappinggenerator)** - Automatic object-to-object mapping with type safety - **[πŸ”„ EnumMappingGenerator](#-enummappinggenerator)** - Automatic enum-to-enum mapping with intelligent matching +## πŸ“¦ Installation + +All generators are distributed in a single NuGet package. Install once to use all features. + +**Required:** +```bash +dotnet add package Atc.SourceGenerators +``` + +**Optional (recommended for better IntelliSense):** +```bash +dotnet add package Atc.SourceGenerators.Annotations +``` + +Or in your `.csproj`: + +```xml + + + + + + + +``` + +**Note:** The generator emits fallback attributes automatically, so the Annotations package is optional. However, it provides better XML documentation and IntelliSense. If you include it, suppress the expected CS0436 warning: `$(NoWarn);CS0436` + --- ### ⚑ DependencyRegistrationGenerator @@ -93,34 +121,6 @@ public class EmailService : IEmailService, INotificationService { } public class ReportService : IReportService { } ``` -#### πŸ“¦ Installation - -**Required:** -```bash -dotnet add package Atc.SourceGenerators -``` - -**Optional (recommended for better IntelliSense):** -```bash -dotnet add package Atc.SourceGenerators.Annotations -``` - -Or in your `.csproj`: - -```xml - - - - - - - -``` - -**Note:** The generator emits fallback attributes automatically, so the Annotations package is optional. However, it provides better XML documentation and IntelliSense. If you include it, suppress the expected CS0436 warning: `$(NoWarn);CS0436` - -See the [complete guide](docs/generators/DependencyRegistration.md) for multi-project setups. - #### πŸ”§ Service Lifetimes ```csharp @@ -277,32 +277,6 @@ public class MyService } ``` -#### πŸ“¦ Installation - -**Required:** -```bash -dotnet add package Atc.SourceGenerators -``` - -**Optional (recommended for better IntelliSense):** -```bash -dotnet add package Atc.SourceGenerators.Annotations -``` - -Or in your `.csproj`: - -```xml - - - - - - - -``` - -**Note:** The generator emits fallback attributes automatically, so the Annotations package is optional. However, it provides better XML documentation and IntelliSense. If you include it, suppress the expected CS0436 warning: `$(NoWarn);CS0436` - #### πŸ›‘οΈ Compile-Time Safety | ID | Description | @@ -399,6 +373,7 @@ var dtos = users.Select(u => u.MapToUserDto()).ToList(); - **πŸͺ† Nested Object Mapping**: Automatically chains mappings for nested properties - **πŸ” Multi-Layer Support**: Build Entity β†’ Domain β†’ DTO mapping chains effortlessly - **⚑ Zero Runtime Cost**: All code generated at compile time +- **πŸš€ Native AOT Compatible**: No reflection or runtime code generation - fully trimming-safe - **πŸ›‘οΈ Type-Safe**: Compile-time validation catches mapping errors before runtime - **πŸ“¦ Null Safety**: Built-in null checking for nullable reference types - **🎯 Convention-Based**: Maps properties by name - no configuration needed @@ -460,32 +435,6 @@ var dto = person.MapToPersonDto(); // ✨ Null safety built-in ``` -#### πŸ“¦ Installation - -**Required:** -```bash -dotnet add package Atc.SourceGenerators -``` - -**Optional (recommended for better IntelliSense):** -```bash -dotnet add package Atc.SourceGenerators.Annotations -``` - -Or in your `.csproj`: - -```xml - - - - - - - -``` - -**Note:** The generator emits fallback attributes automatically, so the Annotations package is optional. However, it provides better XML documentation and IntelliSense. If you include it, suppress the expected CS0436 warning: `$(NoWarn);CS0436` - #### πŸ” Multi-Layer Architecture Perfect for 3-layer architectures: @@ -659,32 +608,6 @@ var dto = entity.MapToStatusDto(); // StatusDto.Unknown var back = dto.MapToStatusEntity(); // StatusEntity.None (bidirectional!) ``` -#### πŸ“¦ Installation - -**Required:** -```bash -dotnet add package Atc.SourceGenerators -``` - -**Optional (recommended for better IntelliSense):** -```bash -dotnet add package Atc.SourceGenerators.Annotations -``` - -Or in your `.csproj`: - -```xml - - - - - - - -``` - -**Note:** The generator emits fallback attributes automatically, so the Annotations package is optional. However, it provides better XML documentation and IntelliSense. If you include it, suppress the expected CS0436 warning: `$(NoWarn);CS0436` - #### πŸ›‘οΈ Compile-Time Safety Get errors and warnings at compile time, not runtime: