44| Project Topics Library
55\=============================================================================================================================*/
66using System ;
7+ using OnTopic . Metadata ;
78
89namespace OnTopic . Mapping . Annotations {
910
1011 /*============================================================================================================================
1112 | ENUM: RELATIONSHIPS
1213 \---------------------------------------------------------------------------------------------------------------------------*/
1314 /// <summary>
14- /// Enum that allows one or more relationship types to be specified.
15+ /// Allows one or more relationship types to be specified.
1516 /// </summary>
1617 /// <remarks>
17- /// This differs from <see cref="RelationshipType"/>, which only allows <i>one</i> relationship to be specified.
18+ /// <para>
19+ /// The <see cref="TopicMappingService"/> and <see cref="FollowAttribute"/> use the <see cref="Relationships"/> enum to
20+ /// determine what relationships should be mapped—or followed as part of the mapping process. This helps constrain the
21+ /// scope of the object graph to only include the data needed for a given view, or vice verse. That said, the <see
22+ /// cref="Relationships"/> enum can be used any place where the code needs to model multiple types of relationships
23+ /// relevant to the <see cref="Topic"/> class and its view models.
24+ /// </para>
25+ /// <para>
26+ /// This differs from <see cref="RelationshipType"/>, which only allows <i>one</i> relationship to be specified.
27+ /// </para>
1828 /// </remarks>
1929 [ Flags ]
2030 public enum Relationships {
2131
22- #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
23-
32+ /*==========================================================================================================================
33+ | NONE
34+ \-------------------------------------------------------------------------------------------------------------------------*/
35+ /// <summary>
36+ /// Do not follow any relationships.
37+ /// </summary>
2438 None = 0 ,
39+
40+ /*==========================================================================================================================
41+ | PARENTS
42+ \-------------------------------------------------------------------------------------------------------------------------*/
43+ /// <summary>
44+ /// Map <see cref="Topic.Parent"/> references.
45+ /// </summary>
2546 Parents = 1 ,
47+
48+ /*==========================================================================================================================
49+ | CHILDREN
50+ \-------------------------------------------------------------------------------------------------------------------------*/
51+ /// <summary>
52+ /// Map <see cref="Topic.Children"/> references, or properties marked as <see cref="RelationshipType.Children"/>.
53+ /// </summary>
2654 Children = 1 << 1 ,
55+
56+ /*==========================================================================================================================
57+ | RELATIONSHIPS
58+ \-------------------------------------------------------------------------------------------------------------------------*/
59+ /// <summary>
60+ /// Map <see cref="Topic.Relationships"/> references, or properties marked as <see cref="RelationshipType.Relationship"/>.
61+ /// </summary>
2762 Relationships = 1 << 2 ,
63+
64+ /*==========================================================================================================================
65+ | INCOMING RELATIONSHIPS
66+ \-------------------------------------------------------------------------------------------------------------------------*/
67+ /// <summary>
68+ /// Map <see cref="Topic.IncomingRelationships"/> references, or properties marked as <see
69+ /// cref="RelationshipType.IncomingRelationship"/>.
70+ /// </summary>
2871 IncomingRelationships = 1 << 3 ,
72+
73+ /*==========================================================================================================================
74+ | MAPPED COLLECTIONS
75+ \-------------------------------------------------------------------------------------------------------------------------*/
76+ /// <summary>
77+ /// Map to any collection on the <see cref="Topic"/> with either the same property name, or which corresponds to the <see
78+ /// cref="AttributeKeyAttribute.Value"/>.
79+ /// </summary>
80+ /// <remarks>
81+ /// This allows mapping of custom collection, such as <see cref="ContentTypeDescriptor.AttributeDescriptors"/>.
82+ /// </remarks>
2983 MappedCollections = 1 << 4 ,
84+
85+ /*==========================================================================================================================
86+ | REFERENCES
87+ \-------------------------------------------------------------------------------------------------------------------------*/
88+ /// <summary>
89+ /// Map topic pointer references, such as <see cref="Topic.DerivedTopic"/>.
90+ /// </summary>
91+ /// <remarks>
92+ /// By convention, <see cref="References"/> types refer to a <see cref="AttributeDescriptor"/>, <see
93+ /// cref="AttributeKeyAttribute.Value"/>, or property identifier ending in <c>Id</c>.
94+ /// </remarks>
3095 References = 1 << 5 ,
31- All = Parents | Children | Relationships | IncomingRelationships | MappedCollections | References
3296
33- #pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
97+ /*==========================================================================================================================
98+ | ALL
99+ \-------------------------------------------------------------------------------------------------------------------------*/
100+ /// <summary>
101+ /// Map all relationship types.
102+ /// </summary>
103+ All = Parents | Children | Relationships | IncomingRelationships | MappedCollections | References
34104
35105 } //Enum
36106} //Namespace
0 commit comments