com.wiwish.library.MapSharp 0.9.0

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

MapSharp

MapSharp is a lightweight, high-performance .NET object-to-object mapper that keeps mapping configuration explicit, readable, and easy to maintain.

Current package version: 0.8.0

Quick start

var configuration = new MapperConfiguration(cfg =>
{
	cfg.CreateMap<User, UserDto>()
		.ForMember(d => d.DisplayName, opt => opt.MapFrom(s => s.Name));
});

configuration.AssertConfigurationIsValid();

var mapper = configuration.CreateMapper();
var dto = mapper.Map<UserDto>(new User { Name = "Alice" });

Current feature coverage

Version 0.8.0 emphasizes faster steady-state runtime mapping while preserving the existing explicit configuration model and feature set.

  • Mapping configuration:
    • CreateMap<TSource, TDestination>()
    • ForMember(...).MapFrom(expression)
    • ForMember(...).MapFrom<TResolver>()
    • ForMember(...).MapFromWithContext<TResolver>()
    • ForMember(...).Condition(...) (runtime mapping only)
    • Ignore(...) for destination properties, including read-only properties when you want them excluded from validation/mapping rules
    • ForSourceMember(..., opt => opt.DoNotValidate()) when source-member validation is enabled
    • ConvertUsing<TConverter>()
    • BeforeMap<TAction>() / AfterMap<TAction>()
    • ReverseMap() basics
  • Runtime mapping:
    • Typed and object-based Map(...) overloads
    • Map-into-existing-instance overload: Map<TSource, TDestination>(source, destination)
      • Typed options overload: Map<TSource, TDestination>(source, Action<IMappingOperationOptions<TSource, TDestination>> options)
      • Automatic proxy-aware source type fallback (exact runtime source type first, then configured base types/interfaces)
    • Configuration access from mapper via IMapper.ConfigurationProvider
    • Nested object mapping
    • Collection mapping (arrays and common list/enumerable destinations)
    • Primitive and enum conversion support
    • Per-call mapping items via IMappingOperationOptions.Items
    • Typed per-call option helpers via Set<T>(...) and TryGet<T>(...)
  • Projection:
    • IQueryable projection via ProjectTo
    • Supports convention mapping, MapFrom(expression), and Ignore(...)
  • Extensibility hooks:
    • ITypeConverter<TSource, TDestination>
    • IValueResolver<TSource, TDestination, TDestMember>
    • IValueResolverWithContext<TSource, TDestination, TDestMember>
    • IMappingAction<TSource, TDestination>
  • Configuration validation via AssertConfigurationIsValid()
    • Optional relaxed validation via AllowUnmappedDestinationMembers()
    • Optional strict source-member validation via ValidateSourceMembers()
    • Source members consumed through custom resolvers cannot be inferred statically; mark them with ForSourceMember(..., opt => opt.DoNotValidate()) when needed
  • DI integration package: MapSharp.Extensions.Microsoft.DependencyInjection
    • ConstructServicesUsing(Func<Type, object>)
    • ConstructServicesUsing(IServiceProvider)

Known limitations

  • Configuration API is intentionally smaller than other similar tools.
  • ProjectTo does not support ConvertUsing, resolver-based members, BeforeMap/AfterMap, or conditional member mapping.
  • Advanced member options and naming-convention customization are not yet complete.
  • Source-member validation only understands convention-based mappings and MapFrom(expression); resolver-based source usage must be marked explicitly with ForSourceMember(..., opt => opt.DoNotValidate()).

Release documentation

Benchmark baseline

A simple benchmark harness is included in benchmarks/MapSharp.Benchmarks. It uses BenchmarkDotNet and writes reports to BenchmarkDotNet.Artifacts. Recent benchmark work for 0.8.0 focused on improving warmed mapping throughput and reducing runtime overhead in common mapping scenarios. Run it with:

dotnet run --project benchmarks/MapSharp.Benchmarks/MapSharp.Benchmarks.csproj -c Release
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.
  • net10.0

    • No dependencies.
  • net8.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on com.wiwish.library.MapSharp:

Package Downloads
com.wiwish.library.MapSharp.Extensions.Microsoft.DependencyInjection

Dependency injection integration for MapSharp with streamlined MapperConfiguration and IMapper registration for ASP.NET Core and .NET applications, plus on-demand construction of resolvers, converters, and mapping actions through ActivatorUtilities.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.9.0 57 9/15/2026
0.8.0 175 7/16/2026
0.7.0 152 7/15/2026
0.6.0 112 7/10/2026
0.5.0 109 7/9/2026
0.4.0 118 7/9/2026
0.3.1 112 7/7/2026
0.3.0 153 7/7/2026
0.2.0 156 7/4/2026
0.1.0-alpha.1 81 7/2/2026

0.9.0: Added optional source-member validation via ValidateSourceMembers(), ForSourceMember(..., opt => opt.DoNotValidate()) for explicit source opt-outs, support for Ignore(...) on read-only destination properties, expanded regression coverage, and refreshed documentation for the new validation and DI guidance.