-
Notifications
You must be signed in to change notification settings - Fork 2
Feature: [MapAs()] attribute #41
Copy link
Copy link
Closed
Labels
Area: MappingRelates to one of the `ITopicMappingService` interfaces or implementations.Relates to one of the `ITopicMappingService` interfaces or implementations.Priority: 1Status 5: CompleteTask is considered complete, and ready for deployment.Task is considered complete, and ready for deployment.Type: FeatureIntroduces a major area of functionality.Introduces a major area of functionality.
Milestone
Metadata
Metadata
Assignees
Labels
Area: MappingRelates to one of the `ITopicMappingService` interfaces or implementations.Relates to one of the `ITopicMappingService` interfaces or implementations.Priority: 1Status 5: CompleteTask is considered complete, and ready for deployment.Task is considered complete, and ready for deployment.Type: FeatureIntroduces a major area of functionality.Introduces a major area of functionality.
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}TopicViewModelconvention.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 possiblyImageUriandDescription.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.