Facet.Mapping 1.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Facet.Mapping --version 1.1.0
                    
NuGet\Install-Package Facet.Mapping -Version 1.1.0
                    
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="Facet.Mapping" Version="1.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Facet.Mapping" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Facet.Mapping" />
                    
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 Facet.Mapping --version 1.1.0
                    
#r "nuget: Facet.Mapping, 1.1.0"
                    
#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 Facet.Mapping@1.1.0
                    
#: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=Facet.Mapping&version=1.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Facet.Mapping&version=1.1.0
                    
Install as a Cake Tool

Facet.Mapping

Facet.Mapping enables advanced static mapping logic for the Facet source generator.

This package defines a strongly-typed interface that allows you to plug in custom mapping logic between source and generated Facet types � all at compile time, with zero runtime reflection.


What is this for?

Facet lets you define slim, redacted, or projected versions of classes using just attributes.
With Facet.Mapping, you can go further � and define custom logic like combining properties, renaming, transforming types, or applying conditions.


How it works

  1. Implement the IFacetMapConfiguration<TSource, TTarget> interface.
  2. Define a static Map method.
  3. Point the [Facet(...)] attribute to the config class using Configuration = typeof(...).

Install

dotnet add package Facet.Mapping

## Example

```csharp
public class User
{
    public string FirstName { get; set; }
    public string LastName { get; set; }
}

[Facet(typeof(User), GenerateConstructor = true, Configuration = typeof(UserMapper))]
public partial class UserDto
{
    public string FullName { get; set; }
}
public class UserMapper : IFacetMapConfiguration<User, UserDto>
{
    public static void Map(User source, UserDto target)
    {
        target.FullName = $"{source.FirstName} {source.LastName}";
    }
}

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Facet.Mapping:

Package Downloads
Facet.Mapping.Expressions

Expression tree transformation and mapping utilities for Facet DTOs. Transform predicates, selectors, and other expressions between source entities and their Facet projections.

Facet.Extensions.EFCore.Mapping

Advanced custom async mapper support for Facet with EF Core queries. Enables complex mappings that cannot be expressed as SQL projections.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
5.3.0 54 1/2/2026
5.2.0 369 12/23/2025
5.2.0-alpha 299 12/18/2025
5.1.12 480 12/14/2025
5.1.11 556 12/9/2025
5.1.10 643 12/5/2025
5.1.9 768 12/3/2025
5.1.8 1,661 12/1/2025
5.1.7 574 12/1/2025
5.1.6 168 11/28/2025
5.1.5 155 11/28/2025
5.1.4 184 11/28/2025
5.1.3 187 11/28/2025
5.1.2 222 11/27/2025
5.1.1 216 11/27/2025
5.1.0 227 11/27/2025
5.0.4 733 11/26/2025
5.0.3 347 11/26/2025
5.0.2 259 11/26/2025
5.0.1 239 11/25/2025
5.0.0 333 11/24/2025
5.0.0-alpha5 208 11/24/2025
5.0.0-alpha4 199 11/23/2025
5.0.0-alpha3 204 11/22/2025
5.0.0-alpha2 212 11/22/2025
5.0.0-alpha 289 11/21/2025
4.4.3 409 11/21/2025
4.4.2 387 11/21/2025
4.4.1 440 11/20/2025
4.4.1-alpha4 306 11/16/2025
4.4.1-alpha3 301 11/16/2025
4.4.1-alpha2 300 11/16/2025
4.4.1-alpha 303 11/16/2025
4.4.0 480 11/15/2025
4.4.0-alpha 244 11/14/2025
4.3.3.1 277 11/14/2025
4.3.3 267 11/14/2025
4.3.2.1 259 11/14/2025
4.3.2 400 11/13/2025
4.3.1 346 11/12/2025
4.3.0 907 11/8/2025
4.3.0-alpha 173 11/7/2025
3.4.0 167 11/8/2025
3.3.0 235 11/7/2025
3.3.0-alpha.1 154 11/4/2025
3.3.0-alpha 204 11/3/2025
3.2.2 2,458 10/29/2025
3.2.1 1,057 10/27/2025
3.2.1-alpha.1 137 10/27/2025
3.2.1-alpha 191 10/26/2025
3.2.0-alpha 189 10/26/2025
3.1.14 317 10/24/2025
3.1.13 285 10/24/2025
3.1.12 530 10/21/2025
3.1.11 200 10/21/2025
3.1.5 189 10/24/2025
3.1.4 198 10/23/2025
3.1.3 194 10/23/2025
3.1.3-alpha 187 10/22/2025
3.1.2 185 10/21/2025
3.1.2-alpha 189 10/22/2025
3.1.1 206 10/21/2025
3.1.0 280 10/19/2025
3.0.0 160 10/17/2025
2.9.31 414 10/13/2025
2.9.3 355 10/8/2025
2.9.3-alpha 187 10/7/2025
2.9.2 1,428 10/6/2025
2.9.1 168 10/3/2025
2.9.0 284 10/1/2025
2.8.2 236 10/1/2025
2.8.1 1,401 9/21/2025
2.8.0 1,205 9/17/2025
2.7.0 526 9/12/2025
2.6.2 207 9/12/2025
2.6.1 352 9/10/2025
2.6.0 242 9/9/2025
2.5.0 406 9/4/2025
2.4.8 198 9/3/2025
2.4.7 438 9/1/2025
2.4.6 178 9/1/2025
2.4.5 246 8/30/2025
2.4.4 313 8/27/2025
2.4.3 225 8/27/2025
2.4.2 226 8/27/2025
2.4.0 211 8/26/2025
2.3.0 489 8/20/2025
2.2.0 183 8/20/2025
2.1.0 203 8/18/2025
2.0.1 661 8/5/2025
2.0.0 195 8/4/2025
1.9.3 169 7/4/2025
1.8.0 219 6/4/2025
1.7.0 216 5/6/2025
1.6.0 190 4/27/2025
1.5.0 181 4/26/2025
1.4.0 212 4/25/2025
1.3.0 235 4/24/2025
1.2.0 231 4/24/2025
1.1.1 235 4/23/2025
1.1.0 226 4/23/2025
1.0.0 795 4/23/2025