Bsft.Mapping 2.2.0.1

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

Bsft.Mapping

Convention-based object and expression mapping: profiles declare type pairs, the mapper maps instances, and the same profile produces a LINQ projection EF Core can translate into SQL.

Install

dotnet add package Bsft.Mapping

Requires Bsft.Core (for IStartupValidator); no third-party mapping library.

Register

services.AddBsftMapping(mapping => mapping.AddProfilesFromAssembly(typeof(Program).Assembly));

Nothing else is required. There is no IConfiguration overload: what this package needs is a set of assemblies to scan and the profiles inside them, and neither is a value a configuration provider can supply. Every non-abstract MappingProfileBase in the scanned assemblies is instantiated by reflection and folded into one mapper, registered as a singleton alongside IMappingValidationService and an IStartupValidator that fails the application at startup if a mapping is incomplete.

Configure

None. The package binds no configuration section and exposes no options type. MappingConfiguration and MemberMapOptions<TSource, TMember> are builder-configuration values that live for the duration of a call, not options in the sense of the conventions, so neither carries a SectionName.

Option Default Effect
— — —

Validation: MappingStartupValidator runs IMappingValidationService at startup and reports every destination member no source member and no explicit rule accounts for. A mapping that cannot be completed throws MappingValidationException naming the type pair and the members. Only members the mapper may assign are required to be accounted for.

What the mapper writes: a destination property is assigned only when it has a public setter. A property is public as soon as its getter is, so a { get; private set; } member would otherwise be writable through reflection and mapping a DTO onto a tracked entity would overwrite exactly what the entity made unsettable. Members without a public setter are still matched by name, because an immutable destination takes them through its constructor.

Each type pair is registered once, across profiles as well as within one, and naming an assembly twice scans it once.

Extend

MappingProfileBase is the extension point and the one type here designed for inheritance: derive a profile, override Configure, and describe type pairs with ProfileBuilder and MapBuilder<TSource, TDest> (MapFrom, Ignore). It needs a public parameterless constructor, because it is instantiated by reflection. IMapper and IMappingValidationService are registered as plain singletons, so a host that registers its own implementation before calling AddBsftMapping gets both registrations and the last one wins.

Documentation

Topic page: docs/mapping.md. Conventions: docs/package-conventions.md.

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 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.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.3.0 57 11/27/2026
2.2.0.1 113 10/31/2026
2.2.0 113 10/23/2026
2.1.0 131 9/28/2026