You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 15/umbraco-cms/reference/mapping.md
+8-11Lines changed: 8 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,11 +5,9 @@ Often in code there is a need to 'map' one object's properties to another type o
5
5
{% hint style="info" %}
6
6
UmbracoMapper replaced AutoMapper which was an external dependency. AutoMapper builds the mapping code dynamically, based upon mapping profiles, which are defined as C# expressions. UmbracoMapper relies on static code, that is, mappings need to be hand-written.
7
7
8
-
This is not to be confused with the [UmbracoMapper package by Andy Butland](https://our.umbraco.com/packages/developer-tools/umbraco-mapper)of the same name.
8
+
If you need to map `IPublishedContent`, you might need a **custom implementation** or a **third-party solution like**[**Andy Butland’s Umbraco Mapper**](https://our.umbraco.com/packages/developer-tools/umbraco-mapper)**(**which has been renamed to [Anaximapper](https://www.andybutland.dev/2022/08/a-quick-post-on-view-model-mapping.html)) rather than relying on Umbraco's `IUmbracoMapper.`
9
9
{% endhint %}
10
10
11
-
UmbracoMapper was originally introduced to solve some issues in the Umbraco core code. However, it is fine for anyone to use in their custom site implementations or packages as they wish.
12
-
13
11
## Accessing the IUmbracoMapper
14
12
15
13
The IUmbracoMapper is registered with Dependency Injection (DI). It can therefore be injected into constructors of controllers, custom classes etc, wherever DI is used.
@@ -90,22 +88,21 @@ The mapping action is used to map an instance of the source class, to an instanc
90
88
91
89
The constructor function is used whenever the mapper is asked to create a target instance. Then, themappingactionisused.
0 commit comments