| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
ACMEMAPPER has been developed focusing on mapping definition maintainability & lisibility over flexibility & performance: mapping definitions are declared in JSON and reloaded on each new ACMEMAPPER object. Many source or destination objects type are supported such JObject or any POCO ones. ACMEMAPPER has been initiality developed in context of an Enterprise Service Bus which has to support & manage many mapping activities and update mapping definitions without re-build & deploy.
Mapping definition
{
"myobjecttype" : [
{
"systemA" : "systemAfield1",
"systemB" : "systemBfield1"
},
{
"systemA" : "systemAfield2",
"systemB" : "systemBfield2"
}
]
}C# source code with
using acmemapper;
...
var mapper = new Mapper("systemA", "systemB");
var output = mapper.Map<JObject,JObject>("myobjecttype",new JObject { { "systemAfield1" , "mystringvalue" } });JObject/JSON output
{
"systemBfield1" : "mystringvalue"
}A sligthly more complex mapping definition including modifiers
{
"myobjecttype": [
{
"systemA": "systemAfield2",
"systemB": {
"property": "systemBfield2",
"fromsubproperty": "nestedsourceproperty",
"tosubproperty": "nesteddestinationproperty",
"ignoreIfNull": true,
"invoke": "ToUpperInvariant",
"map": {
"MYSTRINGVALUE": "mappedvalueinupperletter",
"mystringvalue": "mappedvalueinsmallletter",
"myintegervalue": 1,
"$default": false
}
}
}
]
}JSON input
{
"systemAfield2": {
"nestedsourceproperty": "mystringvalue"
}
}JSON output
{
"systemBfield2": {
"nesteddestinationproperty": "mappedvalueinupperletter"
}
}modifiers orders
ACMEMAPPER supports by design several entity definitions and no limitation of source & destination systems (including both way mapping). By design, ACMEMAPPER supports only as input 2 levels of data (either JSON or POCO object)
{
"level1field" : "value1",
"nestedobject" : {
"level2field" : "subvalue2"
}
}| Back | FazBrowse Home | New Git URL |