Skip to content

Feature: [MapAs()] attribute #41

@JeremyCaney

Description

@JeremyCaney

Currently, associations always rely on the MapAsync(source, associations) overload when mapping associated topics for collections and topic references. A consequence of that is that they effectively mandate that that they are mapped to models using the {ContentType}TopicViewModel convention.

This can be expensive given that, often, associations are only needed for a couple of properties needed to render a link to that topic. In those cases, it would be preferred to map to a lightweight object that only contains the necessary metadata, such as Title, ShortTitle, WebPath (I.e., INavigable) and possibly ImageUri and Description.

Ideally, this would be accomplished by introducing a new attribute, such as [MapTo()] or [MappingType()] and/or even a new property of [Collection()] which which allows the association to specify what type it should be mapped to. This could improve performance on pages with a lot of associations, but which only need a small amount of data.

Metadata

Metadata

Assignees

Labels

Area: MappingRelates to one of the `ITopicMappingService` interfaces or implementations.Priority: 1Status 5: CompleteTask is considered complete, and ready for deployment.Type: FeatureIntroduces a major area of functionality.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions