diff --git a/OnTopic.Tests/BindingModels/InvalidRelationshipTypeTopicBindingModel.cs b/OnTopic.Tests/BindingModels/InvalidRelationshipTypeTopicBindingModel.cs index 921f188e..5dae7c18 100644 --- a/OnTopic.Tests/BindingModels/InvalidRelationshipTypeTopicBindingModel.cs +++ b/OnTopic.Tests/BindingModels/InvalidRelationshipTypeTopicBindingModel.cs @@ -25,7 +25,7 @@ public class InvalidRelationshipTypeTopicBindingModel : BasicTopicBindingModel { public InvalidRelationshipTypeTopicBindingModel(string? key = null) : base(key, "ContentTypeDescriptor") { } - [Relationship(RelationshipType.NestedTopics)] + [Collection(RelationshipType.NestedTopics)] public Collection ContentTypes { get; } = new(); } //Class diff --git a/OnTopic.Tests/TopicMappingServiceTest.cs b/OnTopic.Tests/TopicMappingServiceTest.cs index 348e4064..bc1a5b02 100644 --- a/OnTopic.Tests/TopicMappingServiceTest.cs +++ b/OnTopic.Tests/TopicMappingServiceTest.cs @@ -384,11 +384,11 @@ public async Task Map_Relationships_SkipsDisabled() { \-------------------------------------------------------------------------------------------------------------------------*/ /// /// Establishes a and tests whether it successfully derives values from the key and - /// type specified by . + /// type specified by . /// /// /// The uses to set the relationship key to AmbiguousRelationship and the + /// cref="Mapping.Annotations.CollectionAttribute"/> to set the relationship key to AmbiguousRelationship and the /// to . AmbiguousRelationship /// refers to a relationship that is both outgoing and incoming. It should be smart enough to a) look for the /// AmbigousRelationship instead of the RelationshipAlias, and b) source from the /// /// - /// The uses to set the relationship key to + /// The uses to set the relationship key to /// AmbiguousRelationship and the to . AmbiguousRelationship refers to a relationship that is both /// outgoing and incoming. @@ -27,7 +27,7 @@ namespace OnTopic.Tests.ViewModels { /// public class AmbiguousRelationTopicViewModel: KeyOnlyTopicViewModel { - [Relationship("AmbiguousRelationship", Type=RelationshipType.IncomingRelationship)] + [Collection("AmbiguousRelationship", Type=RelationshipType.IncomingRelationship)] public Collection RelationshipAlias { get; } = new(); } //Class diff --git a/OnTopic.Tests/ViewModels/Metadata/ContentTypeDescriptorTopicViewModel.cs b/OnTopic.Tests/ViewModels/Metadata/ContentTypeDescriptorTopicViewModel.cs index 40202b9c..635e3815 100644 --- a/OnTopic.Tests/ViewModels/Metadata/ContentTypeDescriptorTopicViewModel.cs +++ b/OnTopic.Tests/ViewModels/Metadata/ContentTypeDescriptorTopicViewModel.cs @@ -22,7 +22,7 @@ public class ContentTypeDescriptorTopicViewModel { public Collection AttributeDescriptors { get; } = new(); - [Relationship(RelationshipType.MappedCollection)] + [Collection(RelationshipType.MappedCollection)] [Follow(Relationships.None)] public Collection PermittedContentTypes { get; } = new(); diff --git a/OnTopic/Mapping/Annotations/RelationshipAttribute.cs b/OnTopic/Mapping/Annotations/CollectionAttribute.cs similarity index 81% rename from OnTopic/Mapping/Annotations/RelationshipAttribute.cs rename to OnTopic/Mapping/Annotations/CollectionAttribute.cs index 66af9c22..a1bc5d0d 100644 --- a/OnTopic/Mapping/Annotations/RelationshipAttribute.cs +++ b/OnTopic/Mapping/Annotations/CollectionAttribute.cs @@ -7,7 +7,7 @@ namespace OnTopic.Mapping.Annotations { /*============================================================================================================================ - | ATTRIBUTE: RELATIONSHIP + | ATTRIBUTE: COLLECTION \---------------------------------------------------------------------------------------------------------------------------*/ /// /// Provides the with instructions as to which key to follow for the relationship. @@ -21,32 +21,32 @@ namespace OnTopic.Mapping.Annotations { /// /// /// This attribute instructs the to instead look for a specified key. This allows the - /// target property name to be decoupled from the source's relationship key. In addition, this attribute can be used to - /// specify the type of relationship expected, which is useful if there might be ambiguity between relationship names (for - /// example, if there is a with the same key as an ). + /// target property name to be decoupled from the source's collection key. In addition, this attribute can be used to + /// specify the type of collection expected, which is useful if there might be ambiguity between collection names (for + /// example, if there is a with the same key as an ), which is not an uncommon scenario. /// /// [System.AttributeUsage(System.AttributeTargets.Property)] - public sealed class RelationshipAttribute : System.Attribute { + public sealed class CollectionAttribute : System.Attribute { /*========================================================================================================================== | CONSTRUCTOR \-------------------------------------------------------------------------------------------------------------------------*/ /// - /// Annotates a property with the by providing an . + /// Annotates a property with the by providing an . /// /// The key value of the relationships associated with the current property. - public RelationshipAttribute(string key) { + public CollectionAttribute(string key) { TopicFactory.ValidateKey(key, false); Key = key; } /// - /// Annotates a property with the by providing the . + /// Annotates a property with the by providing the . /// /// Optional. The type of collection the relationship is associated with. - public RelationshipAttribute(RelationshipType type = RelationshipType.Any) { + public CollectionAttribute(RelationshipType type = RelationshipType.Any) { Type = type; } diff --git a/OnTopic/Mapping/Internal/PropertyConfiguration.cs b/OnTopic/Mapping/Internal/PropertyConfiguration.cs index b322a7bd..d27c05a9 100644 --- a/OnTopic/Mapping/Internal/PropertyConfiguration.cs +++ b/OnTopic/Mapping/Internal/PropertyConfiguration.cs @@ -92,7 +92,7 @@ public PropertyConfiguration(PropertyInfo property, string? attributePrefix = "" /*------------------------------------------------------------------------------------------------------------------------ | Attributes: Determine relationship key and type \-----------------------------------------------------------------------------------------------------------------------*/ - GetAttributeValue( + GetAttributeValue( property, a => { RelationshipKey = a.Key ?? RelationshipKey; @@ -248,7 +248,7 @@ public PropertyConfiguration(PropertyInfo property, string? attributePrefix = "" /// the DTO to be aliased to a different collection name on the source . /// /// - /// The property corresponds to the property. It + /// The property corresponds to the property. It /// can be assigned by decorating a DTO property with e.g. [Relationship("AlternateRelationshipKey")]. /// /// @@ -269,7 +269,7 @@ public PropertyConfiguration(PropertyInfo property, string? attributePrefix = "" /// be ambiguous between multiple collections. /// /// - /// The property corresponds to the property. It + /// The property corresponds to the property. It /// can be assigned by decorating a DTO property with e.g. [Relationship("AlternateRelationshipKey", /// RelationshipType.Children)]. /// diff --git a/OnTopic/Mapping/Reverse/IReverseTopicMappingService.cs b/OnTopic/Mapping/Reverse/IReverseTopicMappingService.cs index da861e8e..1f9ebfe9 100644 --- a/OnTopic/Mapping/Reverse/IReverseTopicMappingService.cs +++ b/OnTopic/Mapping/Reverse/IReverseTopicMappingService.cs @@ -36,7 +36,7 @@ namespace OnTopic.Mapping.Reverse { /// Despite the differences between the and s, /// many attributes are able to be reused between them. For instance, the can still /// map a property on a binding model to an attribute of a different name on a , just as the can with relationships. Other attributes, however, provde no benefit in the reverse + /// cref="CollectionAttribute"/> can with relationships. Other attributes, however, provde no benefit in the reverse /// scenario, such as or , which really only make /// sense in creating a "produced view" that is a subset of the original model. That is valuable when creating a view /// model, but isn't a useful use case when working with binding models.