Interface IUmbracoMapper
Namespace: Umbraco.Cms.Core.Mapping
Assembly: Umbraco.Core.dll
Syntax
public interface IUmbracoMapper
Methods
View SourceDefine<TSource, TTarget>()
Defines a mapping.
Declaration
void Define<TSource, TTarget>()
Type Parameters
| Name | Description |
|---|---|
| TSource | The source type. |
| TTarget | The target type. |
Define<TSource, TTarget>(Action<TSource, TTarget, MapperContext>)
Defines a mapping.
Declaration
void Define<TSource, TTarget>(Action<TSource, TTarget, MapperContext> map)
Parameters
| Type | Name | Description |
|---|---|---|
| Action<TSource, TTarget, MapperContext> | map | A mapping method. |
Type Parameters
| Name | Description |
|---|---|
| TSource | The source type. |
| TTarget | The target type. |
Define<TSource, TTarget>(Func<TSource, MapperContext, TTarget>)
Defines a mapping.
Declaration
void Define<TSource, TTarget>(Func<TSource, MapperContext, TTarget> ctor)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<TSource, MapperContext, TTarget> | ctor | A constructor method. |
Type Parameters
| Name | Description |
|---|---|
| TSource | The source type. |
| TTarget | The target type. |
Define<TSource, TTarget>(Func<TSource, MapperContext, TTarget>, Action<TSource, TTarget, MapperContext>)
Defines a mapping.
Declaration
void Define<TSource, TTarget>(Func<TSource, MapperContext, TTarget> ctor, Action<TSource, TTarget, MapperContext> map)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<TSource, MapperContext, TTarget> | ctor | A constructor method. |
| Action<TSource, TTarget, MapperContext> | map | A mapping method. |
Type Parameters
| Name | Description |
|---|---|
| TSource | The source type. |
| TTarget | The target type. |
Map<TTarget>(Object)
Maps a source object to a new target object.
Declaration
TTarget Map<TTarget>(object source)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | source | The source object. |
Returns
| Type | Description |
|---|---|
| TTarget | The target object. |
Type Parameters
| Name | Description |
|---|---|
| TTarget | The target type. |
Map<TTarget>(Object, Action<MapperContext>)
Maps a source object to a new target object.
Declaration
TTarget Map<TTarget>(object source, Action<MapperContext> f)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | source | The source object. |
| Action<MapperContext> | f | A mapper context preparation method. |
Returns
| Type | Description |
|---|---|
| TTarget | The target object. |
Type Parameters
| Name | Description |
|---|---|
| TTarget | The target type. |
Map<TTarget>(Object, MapperContext)
Maps a source object to a new target object.
Declaration
TTarget Map<TTarget>(object source, MapperContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | source | The source object. |
| MapperContext | context | A mapper context. |
Returns
| Type | Description |
|---|---|
| TTarget | The target object. |
Type Parameters
| Name | Description |
|---|---|
| TTarget | The target type. |
Map<TSource, TTarget>(TSource)
Maps a source object to a new target object.
Declaration
TTarget Map<TSource, TTarget>(TSource source)
Parameters
| Type | Name | Description |
|---|---|---|
| TSource | source | The source object. |
Returns
| Type | Description |
|---|---|
| TTarget | The target object. |
Type Parameters
| Name | Description |
|---|---|
| TSource | The source type. |
| TTarget | The target type. |
Map<TSource, TTarget>(TSource, TTarget)
Maps a source object to an existing target object.
Declaration
TTarget Map<TSource, TTarget>(TSource source, TTarget target)
Parameters
| Type | Name | Description |
|---|---|---|
| TSource | source | The source object. |
| TTarget | target | The target object. |
Returns
| Type | Description |
|---|---|
| TTarget | The target object. |
Type Parameters
| Name | Description |
|---|---|
| TSource | The source type. |
| TTarget | The target type. |
Map<TSource, TTarget>(TSource, TTarget, Action<MapperContext>)
Maps a source object to an existing target object.
Declaration
TTarget Map<TSource, TTarget>(TSource source, TTarget target, Action<MapperContext> f)
Parameters
| Type | Name | Description |
|---|---|---|
| TSource | source | The source object. |
| TTarget | target | The target object. |
| Action<MapperContext> | f | A mapper context preparation method. |
Returns
| Type | Description |
|---|---|
| TTarget | The target object. |
Type Parameters
| Name | Description |
|---|---|
| TSource | The source type. |
| TTarget | The target type. |
Map<TSource, TTarget>(TSource, TTarget, MapperContext)
Maps a source object to an existing target object.
Declaration
TTarget Map<TSource, TTarget>(TSource source, TTarget target, MapperContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| TSource | source | The source object. |
| TTarget | target | The target object. |
| MapperContext | context | A mapper context. |
Returns
| Type | Description |
|---|---|
| TTarget | The target object. |
Type Parameters
| Name | Description |
|---|---|
| TSource | The source type. |
| TTarget | The target type. |
Map<TSource, TTarget>(TSource, Action<MapperContext>)
Maps a source object to a new target object.
Declaration
TTarget Map<TSource, TTarget>(TSource source, Action<MapperContext> f)
Parameters
| Type | Name | Description |
|---|---|---|
| TSource | source | The source object. |
| Action<MapperContext> | f | A mapper context preparation method. |
Returns
| Type | Description |
|---|---|
| TTarget | The target object. |
Type Parameters
| Name | Description |
|---|---|
| TSource | The source type. |
| TTarget | The target type. |
Map<TSource, TTarget>(TSource, MapperContext)
Maps a source object to a new target object.
Declaration
TTarget Map<TSource, TTarget>(TSource source, MapperContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| TSource | source | The source object. |
| MapperContext | context | A mapper context. |
Returns
| Type | Description |
|---|---|
| TTarget | The target object. |
Type Parameters
| Name | Description |
|---|---|
| TSource | The source type. |
| TTarget | The target type. |
MapEnumerable<TSourceElement, TTargetElement>(IEnumerable<TSourceElement>)
Maps an enumerable of source objects to a new list of target objects.
Declaration
List<TTargetElement> MapEnumerable<TSourceElement, TTargetElement>(IEnumerable<TSourceElement> source)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<TSourceElement> | source | The source objects. |
Returns
| Type | Description |
|---|---|
| List<TTargetElement> | A list containing the target objects. |
Type Parameters
| Name | Description |
|---|---|
| TSourceElement | The type of the source objects. |
| TTargetElement | The type of the target objects. |
MapEnumerable<TSourceElement, TTargetElement>(IEnumerable<TSourceElement>, Action<MapperContext>)
Maps an enumerable of source objects to a new list of target objects.
Declaration
List<TTargetElement> MapEnumerable<TSourceElement, TTargetElement>(IEnumerable<TSourceElement> source, Action<MapperContext> f)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<TSourceElement> | source | The source objects. |
| Action<MapperContext> | f | A mapper context preparation method. |
Returns
| Type | Description |
|---|---|
| List<TTargetElement> | A list containing the target objects. |
Type Parameters
| Name | Description |
|---|---|
| TSourceElement | The type of the source objects. |
| TTargetElement | The type of the target objects. |
MapEnumerable<TSourceElement, TTargetElement>(IEnumerable<TSourceElement>, MapperContext)
Maps an enumerable of source objects to a new list of target objects.
Declaration
List<TTargetElement> MapEnumerable<TSourceElement, TTargetElement>(IEnumerable<TSourceElement> source, MapperContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<TSourceElement> | source | The source objects. |
| MapperContext | context | A mapper context. |
Returns
| Type | Description |
|---|---|
| List<TTargetElement> | A list containing the target objects. |
Type Parameters
| Name | Description |
|---|---|
| TSourceElement | The type of the source objects. |
| TTargetElement | The type of the target objects. |