Interface IWebPageQueryResultMapper
Mapper which provides mapping of IWebPageContentQueryDataContainer to model.
[Obsolete("This interface is obsolete and will be removed in a future version. Use IContentQueryModelTypeMapper instead.")]
public interface IWebPageQueryResultMapper
- Extension Methods
Methods
Map<TModel>(IWebPageContentQueryDataContainer)
Maps the content query result IWebPageContentQueryDataContainer to specified model TModel properties.
TModel Map<TModel>(IWebPageContentQueryDataContainer dataContainer) where TModel : new()
Parameters
dataContainerIWebPageContentQueryDataContainerIWebPageContentQueryDataContainer containing data to be mapped to the model.
Returns
- TModel
TModelModel with mapped data from thedataContainer.
Type Parameters
TModelType of returned model.
Remarks
The properties of the TModel model are mapped case insensitive by the name, so their names and types need to match the names and types in dataContainer except for special cases:
- ContentItemFields property is mapped by type.
- WebPageFields property is mapped by type.
- Linked items are mapped to System.Collections.Generic.IEnumerable<T> property.
dataContainer will not be mapped.
Exceptions
- ArgumentNullException
Thrown when container is null.
- InvalidOperationException
Thrown when the data cannot be bound to the model e.g., the types of the properties doesn't match.