-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Add] QueryReferencedThings() and QueryReferencedThingsDeep() methods to the abstract Thing class #143
[Add] QueryReferencedThings() and QueryReferencedThingsDeep() methods to the abstract Thing class #143
Changes from 1 commit
195adb0
d0199b4
578f572
00da9a2
c5d6db1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -149,8 +149,8 @@ protected Thing(Guid iid, ConcurrentDictionary<CacheKey, Lazy<CommonData.Thing>> | |
[CDPVersion("1.1.0")] | ||
[UmlInformation(aggregation: AggregationKind.None, isDerived: false, isOrdered: false, isNullable: false, isPersistent: true)] | ||
[DataMember] | ||
public virtual List<DomainOfExpertise> ExcludedDomain { get; set; } | ||
public virtual List<DomainOfExpertise> ExcludedDomain { get; set; } | ||
/// <summary> | ||
/// Gets or sets a list of <see cref="Person"/> that are excluded for this instance. | ||
/// </summary> | ||
|
@@ -236,8 +236,8 @@ public CacheKey CacheKey | |
if (this.cacheKey.Thing != Guid.Empty) | ||
{ | ||
return this.cacheKey; | ||
} | ||
} | ||
var iterationContainer = this.GetContainerOfType<Iteration>(); | ||
Guid? iterationId = null; | ||
if (iterationContainer != null && this.ClassKind != ClassKind.Iteration) | ||
|
@@ -273,8 +273,8 @@ public string Route | |
get | ||
{ | ||
var currentType = this.GetType(); | ||
var typeName = currentType.Name; | ||
var typeName = currentType.Name; | ||
if (this is TopContainer) | ||
{ | ||
if (typeName == "SiteDirectory" && this.Iid == Guid.Empty) | ||
|
@@ -288,8 +288,8 @@ public string Route | |
if (this is NotThing) | ||
{ | ||
return "no thing, no route"; | ||
} | ||
} | ||
var container = this.Container; | ||
|
||
if (container == null) | ||
|
@@ -339,6 +339,39 @@ public IEnumerable<Thing> QueryContainedThingsDeep() | |
return temp; | ||
} | ||
|
||
/// <summary> | ||
/// Queries the referenced <see cref="Thing"/>s of the current <see cref="Thing"/> | ||
/// </summary> | ||
/// <remarks> | ||
/// this does not include the contained <see cref="Thing"/>s, the contained <see cref="Thing"/>s | ||
/// are exposed via the <see cref="ContainerLists"/> method | ||
/// </remarks> | ||
/// <returns></returns> | ||
public virtual IEnumerable<Thing> QueryReferencedThings() | ||
{ | ||
return Enumerable.Empty<Thing>(); | ||
} | ||
|
||
/// <summary> | ||
/// Queries all the referenced <see cref="Thing"/>s of the current <see cref="Thing"/>, along the complete | ||
/// referenced <see cref="Thing"/> chain and returns them as a flat list | ||
/// </summary> | ||
/// <returns> | ||
/// An <see cref="IEnumerable{Thing}"/> | ||
/// </returns> | ||
public IEnumerable<Thing> QueryReferencedThingsDeep() | ||
{ | ||
var temp = new List<Thing>(); | ||
|
||
foreach (var thing in this.QueryReferencedThings()) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For For the full tree of things "connected" to the current thing, we would indeed interate through both contained and referenced things. |
||
{ | ||
temp.Add(thing); | ||
temp.AddRange(thing.QueryReferencedThings()); | ||
} | ||
|
||
return temp; | ||
} | ||
|
||
/// <summary> | ||
/// Gets or sets the Change status of this <see cref="Thing"/>. | ||
/// </summary> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing doc