Everything new since V5.0.0.
Remap source collection types (e.g. EF Core's Collection<T>) to List<T> or any other collection type.
CollectionTargetTypeon[Facet], remaps all collection properties on the facet to the given type.AsCollectionon[MapFrom], remaps a single collection property.Collection<T>is now recognised by the collection-detection pipeline (previously silently skipped).ToSource()round-trips correctly, reconstructing the original collection type on the entity.
Custom reverse-mapping configuration via IFacetToSourceConfiguration<TFacet, TSource>, allowing full control over how a facet maps back to its source entity. Supports static and DI-resolved instances.
Facets can now reference source types from other assemblies that expose internals via [InternalsVisibleTo].
ToSource() now correctly handles facets that target inherited entity types, mapping base and derived properties.
Override default [Facet] attribute settings project-wide via MSBuild properties in your .csproj or a Facet.props file, no need to repeat the same options on every attribute.
GenerateCopyConstructor— generates a copy constructor for cloning and MVVM scenarios.GenerateEquality— generates value-basedEquals,GetHashCode,==, and!=for class DTOs.
Full-path nameof expressions using the @ symbol are now supported in [Flatten(Exclude = ...)].
Convert all enum properties on a facet to string or int with full round-trip support in both projection and ToSource().
New analyzer warning FAC023 when GenerateToSource = true but ToSource cannot be generated for specific properties, including the property names in the message.
Before/After hooks to inject validation, defaults, or computed values around the auto-mapping pipeline.
New companion package Facet.Dashboard, a visual overview of all facets, their source types, and generated members in your solution.
Apply a facet's mapping to an existing instance rather than creating a new one.
Generate patch/partial-update DTOs with ApplyFacetWithChanges support.
Generate a public parameterless constructor on the facet type.
Constructors chain to a parameterless constructor when available.
IReadOnlyList<T> and IReadOnlyCollection<T> are now detected and mapped correctly.
New parameter to disable the automatic inclusion of auditable fields (e.g. CreatedAt, UpdatedAt).
Flattened properties that are collections are now copied correctly.
C# 13 partial properties are now handled correctly by the generator.
| Issue / PR | Description |
|---|---|
| #317 | Fix inheritance warnings on generated code |
| #308 | ApplyFacetWithChanges fix |
| #306 | Fix ToSource in nested facets |
| #301 | Fix static members being incorrectly included |
| #298, #299 | Fix PreserveRequiredProperties for record-class facets |
| #296 | Fix TypeAnalyzer errors |
| #278, #277 | Fix copy-attribute bugs |
| #276 | Support full-path nameof using @ symbol |
| #273 | Fix static usings for nested facets |
| #267 | Fix non-nullable reference-type properties without initializers |
| #265 | AOT compatibility fix |
| #262 | Nested facet & nullable reference type fix |
| #259 | Null checks on nested facets |
| #257 | Nested facet nullable-enabled error in generated code |
| #254 | Nullable issues with object properties |
| #252 | Ambiguous constructor call |
| #250 | Same facet name in different namespaces |
| #246 | Generic type parameters in attributes |
| #244 | Copy initializers fix |
| #240 | Copy attributes with enum parameters |
| #236 | Hooks integration fix |
| #225 | Namespace fix for copy attributes |
| #222 | Prevent non-compilable generated code |
| #215 | MapFrom fix |
| #212 | XML documentation syntax for constructor generator |
| #209 | Suppress warning CS1591 on generated code |
| #204 | Nested facet classes fix |
| #203 | Nullable context warnings |
| #198 | FlattenTo naming clash |
| #197 | Remove generator as a runtime dependency |
| #193 | Flatten nested collections |
| #192 | Fix nested custom mappings |
| #189 | Nested facet with duplicate names |
- Performance — generator performance improvements (v5.0.2)
- Constructors order — deterministic ordering of generated constructors (#226)
PreserveRequiredProperties— works correctly for record classes (#298)- Parameterless constructors as primary constructor, included when detected (#297)
- AOT compatibility — generator output is now AOT-friendly (#265)
Facet.props— project-wide configuration via MSBuild props file (v5.8.1)
- Removed generator as a runtime dependency,
Facetis now a pure analyzer/generator package (#197) - New package: Facet.Dashboard (#231)
- New package: Facet.Mapping (for
IFacetToSourceConfiguration) - Targets .NET 8, .NET 9, and .NET 10