Class MapperCollection
Represents a collection of persistence mappers responsible for mapping between database records and domain entities in Umbraco.
Namespace: Umbraco.Cms.Infrastructure.Persistence.Mappers
Assembly: Umbraco.Infrastructure.dll
Syntax
public class MapperCollection : BuilderCollectionBase<BaseMapper>, IMapperCollection, IBuilderCollection<BaseMapper>
Constructors
View SourceMapperCollection(Func<IEnumerable<BaseMapper>>)
Initializes a new instance of the MapperCollection class with a function that provides the collection of BaseMapper instances.
Declaration
public MapperCollection(Func<IEnumerable<BaseMapper>> items)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<IEnumerable<BaseMapper>> | items | A function that returns an System.Collections.Generic.IEnumerable<T> of BaseMapper objects to be included in the collection. |
Properties
View Sourcethis[Type]
Returns a mapper for this type, throw an exception if not found
Declaration
public BaseMapper this[Type type] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| Type | type |
Property Value
| Type | Description |
|---|---|
| BaseMapper |
Methods
View SourceTryGetMapper(Type, out BaseMapper)
Attempts to get a mapper for the specified type.
Declaration
public bool TryGetMapper(Type type, out BaseMapper mapper)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | type | The type to get the mapper for. |
| BaseMapper | mapper | When this method returns, contains the mapper associated with the specified type, if found; otherwise, null. |
Returns
| Type | Description |
|---|---|
| bool | True if a mapper for the specified type was found; otherwise, false. |