ARSoftware.ObjectMapper
2.4.4
See the version list below for details.
dotnet add package ARSoftware.ObjectMapper --version 2.4.4
NuGet\Install-Package ARSoftware.ObjectMapper -Version 2.4.4
<PackageReference Include="ARSoftware.ObjectMapper" Version="2.4.4" />
<PackageVersion Include="ARSoftware.ObjectMapper" Version="2.4.4" />
<PackageReference Include="ARSoftware.ObjectMapper" />
paket add ARSoftware.ObjectMapper --version 2.4.4
#r "nuget: ARSoftware.ObjectMapper, 2.4.4"
#:package ARSoftware.ObjectMapper@2.4.4
#addin nuget:?package=ARSoftware.ObjectMapper&version=2.4.4
#tool nuget:?package=ARSoftware.ObjectMapper&version=2.4.4
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 argumentsupper(arg)- Transforms the argument to upper caselower(arg)- Transforms the argument to lower casejoin(separator, arg1, arg2, ...)- Joins the arguments using the separatorguid()- Generates a new Guidnow()- 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 | Versions 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. |
-
net10.0
- MongoDB.Bson (>= 3.5.2)
- Newtonsoft.Json (>= 13.0.4)
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 |