ARSoftware.ObjectMapper 2.4.2

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

ARSoftware.ObjectMapper

This simple project is built to allow mapping an object into another object using a configuration file written in JSON.

Currently only JSON → JSON mapping is available, but there is potential to add other types in future.

JSON Configuration Documentation

Regular Properties

Basic properties can be mapped using a dollar sign followed by the path to the property on the input object.

{
  "TargetProperty": "$Nested.Property.Path",
  "TargetPropertyTwo": "$PropertyPath"
}

Fixed values can be defined by forgoing the dollar sign.

{
  "TargetProperty": "Fixed String Value",
  "TargetFixedInteger": 1
}

Nested Objects

Nested objects are mapped using a sub configuration, these sub configurations are designed in the same way as the overarching main configuration

{
  "TargetObject": {
    "TargetNestedProperty": "$Source.Property.Path",
    "TargetNestedPropertyFixed": 12
  }
}

Array Mapping

Arrays can be defined using a sub configuration defining both a source and map property, the source does not require a dollar sign. The map property can be either an object or a single value/mapped field

Object values:

{
  "TargetArray": {
    "source": "Path.To.Array",
    "map": {
      "TargetArrayProperty": "$Path.To.Source.Inside.Array"
    }
  }
}

Single values:

{
  "TargetArray": {
    "source": "Path.To.Array",
    "map": "$Path.To.Source.Inside.Array"
  }
}

Functions/Expressions

There are a few functions available to use within the configuration file, and will be executed during the mapping process. These functions are not case-sensitive. Currently available functions are:

  • concat(arg1, arg2, ...) - Concatenates all the arguments
  • upper(arg) - Transforms the argument to upper case
  • lower(arg) - Transforms the argument to lower case
  • join(separator, arg1, arg2, ...) - Joins the arguments using the separator
  • guid() - Generates a new Guid
  • now() - Current DateTime (local)
  • slug(arg) - Creates a slug of the input

As well as the above there are some functions which are for more specific/unique cases (based on my own requirement). There is the ability to convert from MongoDB BinData into a C Sharp Legacy UUID (Guid).

  • csuuid(arg) - Converts a BinData object into a standard C# Guid.
{
  "TargetProperty": "Guid()",
  "TargetSlugProperty": "Slug($SourceProperty)",
  "FullName": "Concat($FirstName, ' ', $LastName)"
}
Product Compatible and additional computed target framework versions.
.NET 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.4.5 105 2/23/2026
2.4.4 98 2/23/2026
2.4.2 101 2/22/2026
2.4.1 106 2/18/2026
2.4.0 109 2/18/2026
2.3.3 99 2/18/2026
2.2.0 107 2/9/2026
2.1.0 436 12/11/2025
2.0.0 423 12/10/2025
1.2.2 449 12/10/2025
1.2.1 431 12/10/2025
1.2.0 440 12/10/2025
1.1.7 444 12/10/2025
1.1.6 438 12/10/2025
1.1.5 435 12/10/2025
1.1.3 437 12/10/2025
1.1.0 429 12/8/2025
1.0.1 203 11/5/2025
1.0.0 195 11/5/2025