ArchPillar.Extensions.Mapper 1.3.6

dotnet add package ArchPillar.Extensions.Mapper --version 1.3.6
                    
NuGet\Install-Package ArchPillar.Extensions.Mapper -Version 1.3.6
                    
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="ArchPillar.Extensions.Mapper" Version="1.3.6" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ArchPillar.Extensions.Mapper" Version="1.3.6" />
                    
Directory.Packages.props
<PackageReference Include="ArchPillar.Extensions.Mapper" />
                    
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 ArchPillar.Extensions.Mapper --version 1.3.6
                    
#r "nuget: ArchPillar.Extensions.Mapper, 1.3.6"
                    
#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 ArchPillar.Extensions.Mapper@1.3.6
                    
#: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=ArchPillar.Extensions.Mapper&version=1.3.6
                    
Install as a Cake Addin
#tool nuget:?package=ArchPillar.Extensions.Mapper&version=1.3.6
                    
Install as a Cake Tool

ArchPillar.Extensions.Mapper

A .NET library for explicit object-to-object DTO mapping and LINQ/EF Core expression projection.

Why?

  • Traceable — every mapper is a named property on a concrete class; Go to Definition and Find All References just work.
  • Explicit — no convention-based auto-mapping. Every mapped property is declared.
  • Dual mode — one definition drives both in-memory object mapping and IQueryable projection.
  • Composable — nested model mappers are reused automatically.
  • Type-safe — unmapped destination properties cause a build-time exception, not a runtime surprise.

Quick Start

// 1. Define your mapper context (like EF Core's DbContext)
public class AppMappers : MapperContext
{
    public Mapper<Address, AddressDto> Address { get; }
    public Mapper<OrderLine, OrderLineDto> OrderLine { get; }
    public Mapper<Order, OrderDto> Order { get; }

    public AppMappers()
    {
        // Single-object mapper
        Address = CreateMapper<Address, AddressDto>(src => new AddressDto
        {
            Street  = src.Street,
            City    = src.City,
            Country = src.Country,
        });

        // Child collection mapper
        OrderLine = CreateMapper<OrderLine, OrderLineDto>(src => new OrderLineDto
        {
            ProductName = src.ProductName,
            Quantity    = src.Quantity,
            UnitPrice   = src.UnitPrice,
        });

        // Parent mapper — nests both:
        //   Map()     for a single object (Address)
        //   Project() for a collection    (OrderLine)
        // Both are inlined automatically, fully translatable by EF Core
        Order = CreateMapper<Order, OrderDto>(src => new OrderDto
        {
            Id           = src.Id,
            CustomerName = src.Customer.Name,
            Total        = src.Total,
            Address      = Address.Map(src.ShippingAddress),
            Lines        = src.Lines.Project(OrderLine).ToList(),
        });
    }
}

// 2. Use it — in memory
var mappers = new AppMappers();
OrderDto dto = mappers.Order.Map(order);

// 3. Use it — as IQueryable projection (single SQL query, no N+1)
var dtos = dbContext.Orders.Project(mappers.Order).ToList();

Documentation

Full documentation and examples are available at the GitHub repository.

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 is compatible.  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 is compatible.  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.
  • net10.0

    • No dependencies.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on ArchPillar.Extensions.Mapper:

Package Downloads
ArchPillar.Extensions.Mapper.EntityFrameworkCore

EF Core integration for ArchPillar.Extensions.Mapper. Translates EnumMapper.Map() calls into flat SQL CASE expressions and inlines direct Mapper.Map()/Project() calls inside hand-written query projections for full server-side translation.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.3.6 62 6/3/2026
1.3.5 78 6/2/2026
1.3.4 113 6/1/2026
1.3.3 113 6/1/2026
1.3.2 126 5/28/2026
1.3.1 117 5/27/2026
1.3.0 119 5/22/2026
1.2.0 118 3/28/2026
1.1.0 105 3/26/2026
1.0.5 101 3/26/2026
1.0.4 107 3/23/2026
1.0.3 450 3/18/2026
1.0.2 99 3/17/2026
1.0.1 131 3/14/2026
1.0.0 108 3/14/2026