What is Facet?
masterFacet is a C# source generator designed to eliminate DTO (Data Transfer Object) boilerplate. It allows you to define a single source of truth (a domain model) and automatically generates various 'facets' (views) of that model for different purposes, such as Public APIs, Admin endpoints, or efficient Database projections.
Key benefits include:
- Compile-time generation: Everything is generated at compile time with zero runtime overhead and no reflection.
- Automated boilerplate: Generates constructors, static factories, LINQ projections, and reverse mappings.
- Type flexibility: Supports generating DTOs as classes, records, structs, or record structs.
- Deep mapping: Automatically handles nested objects and collections.