Skip to content

Commit c16c0a8

Browse files
committed
Renamed CrawlRelationships to IncludeAssociations
To correspond with the rename of the `Relationships` enum to the more general `Associations` (191262a) as well as the rename of the `[Follow()]` attribute to `[Include()]` (7c150d8), I renamed the `CrawlRelationships` property to `IncludeAssociations`.
1 parent 7c150d8 commit c16c0a8

2 files changed

Lines changed: 14 additions & 14 deletions

File tree

OnTopic/Mapping/Internal/PropertyConfiguration.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public PropertyConfiguration(PropertyInfo property, string? attributePrefix = ""
6868
InheritValue = false;
6969
CollectionKey = AttributeKey;
7070
CollectionType = CollectionType.Any;
71-
CrawlRelationships = AssociationTypes.None;
71+
IncludeAssociations = AssociationTypes.None;
7272
MetadataKey = null;
7373
DisableMapping = false;
7474
AttributeFilters = new();
@@ -82,7 +82,7 @@ public PropertyConfiguration(PropertyInfo property, string? attributePrefix = ""
8282
GetAttributeValue<AttributeKeyAttribute>(property, a => AttributeKey = attributePrefix + a.Key);
8383
GetAttributeValue<MapToParentAttribute>(property, a => MapToParent = true);
8484
GetAttributeValue<MapToParentAttribute>(property, a => AttributePrefix += (a.AttributePrefix?? property.Name));
85-
GetAttributeValue<IncludeAttribute>(property, a => CrawlRelationships = a.Associations);
85+
GetAttributeValue<IncludeAttribute>(property, a => IncludeAssociations = a.Associations);
8686
GetAttributeValue<FlattenAttribute>(property, a => FlattenChildren = true);
8787
GetAttributeValue<MetadataAttribute>(property, a => MetadataKey = a.Key);
8888
GetAttributeValue<DisableMappingAttribute>(property, a => DisableMapping = true);
@@ -276,26 +276,26 @@ public PropertyConfiguration(PropertyInfo property, string? attributePrefix = ""
276276
public CollectionType CollectionType { get; set; }
277277

278278
/*==========================================================================================================================
279-
| PROPERTY: CRAWL RELATIONSHIPS
279+
| PROPERTY: INCLUDE ASSOCIATIONS
280280
\-------------------------------------------------------------------------------------------------------------------------*/
281281
/// <summary>
282-
/// Determines which relationships, if any, the <see cref="InterfaceMapping"/> service should crawl for the current
282+
/// Determines which associations, if any, the <see cref="InterfaceMapping"/> service should be included for the current
283283
/// property.
284284
/// </summary>
285285
/// <remarks>
286286
/// <para>
287-
/// By default, the all relationships will be mapped on the target DTO, unless the caller specifies otherwise. On any
288-
/// related DTOs, however, only <see cref="CollectionType.NestedTopics"/> will be mapped. So, if a mapped DTO has a
289-
/// collection for children, relationships, or even a parent property then any relationships on <i>those</i> DTOs will
290-
/// not be mapped. This behavior can be changed by specifying the <see cref="CrawlRelationships"/> flag, which allows
291-
/// one or multiple relationships to be specified for a given property.
287+
/// By default, the all associations will be mapped on the target model, unless the caller specifies otherwise. On any
288+
/// associated models, however, only <see cref="CollectionType.NestedTopics"/> will be mapped. So, if a mapped model has
289+
/// a collection for children, relationships, or even a parent property then any associations on <i>those</i> models
290+
/// will not be mapped. This behavior can be changed by specifying the <see cref="IncludeAssociations"/> flag, which
291+
/// allows one or multiple relationships to be specified for a given property.
292292
/// </para>
293293
/// <para>
294-
/// The <see cref="CrawlRelationships"/> property corresponds to the <see cref="IncludeAttribute.Associations"/>
295-
/// property. It can be assigned by decorating a DTO property with e.g. <c>[Follow(Relationships.Children)]</c>.
294+
/// The <see cref="IncludeAssociations"/> property corresponds to the <see cref="IncludeAttribute.Associations"/>
295+
/// property. It can be assigned by decorating a model property with e.g. <c>[Include(Relationships.Children)]</c>.
296296
/// </para>
297297
/// </remarks>
298-
public AssociationTypes CrawlRelationships { get; set; }
298+
public AssociationTypes IncludeAssociations { get; set; }
299299

300300
/*==========================================================================================================================
301301
| PROPERTY: METADATA KEY

OnTopic/Mapping/TopicMappingService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ configuration.ContentTypeFilter is not null &&
693693
//Map child topic to target DTO
694694
var childDto = (object)childTopic;
695695
if (!typeof(Topic).IsAssignableFrom(listType)) {
696-
taskQueue.Add(MapAsync(childTopic, configuration.CrawlRelationships, cache));
696+
taskQueue.Add(MapAsync(childTopic, configuration.IncludeAssociations, cache));
697697
}
698698
else {
699699
AddToList(childDto);
@@ -771,7 +771,7 @@ MappedTopicCache cache
771771
\-----------------------------------------------------------------------------------------------------------------------*/
772772
var topicDto = (object?)null;
773773
try {
774-
topicDto = await MapAsync(source, configuration.CrawlRelationships, cache).ConfigureAwait(false);
774+
topicDto = await MapAsync(source, configuration.IncludeAssociations, cache).ConfigureAwait(false);
775775
}
776776
catch (InvalidTypeException) {
777777
//Disregard errors caused by unmapped view models; those are functionally equivalent to IsAssignableFrom() mismatches

0 commit comments

Comments
 (0)