-
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
Conversation
… to the abstract Thing class
{ | ||
var temp = new List<Thing>(); | ||
|
||
foreach (var thing in this.QueryReferencedThings()) |
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.
For QueryReferencedThingsDeep
, I was thinking of returning the list of objects referenced from the full containment [sub]tree, not a tree of referenced things: so iterating through this.ContainerList
, not the referenced things.
For the full tree of things "connected" to the current thing, we would indeed interate through both contained and referenced things.
CDP4Common/Poco/Thing.cs
Outdated
/// 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> |
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
just added the code-generated QueryReferencedThing method. I am not sure the requested method to query all so-called |
SonarCloud Quality Gate failed. 0 Bugs |
yield return thing; | ||
} | ||
|
||
foreach (var thing in this.BaseQuantityKind.Select(x => x)) |
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.
I noticed that for some things (most don't have this) that are iterated there's an additional .Select(x =>x)
. Does this serve any purpose? It seems to me like it's adding [execution] complexity for nothing.
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.
It is required to handle ordereditemlist
CDP4Common/AutoGenPoco/ValueGroup.cs
Outdated
/// Queries the referenced <see cref="Thing"/>s of the current <see cref="ValueGroup"/> | ||
/// </summary> | ||
/// <remarks> | ||
/// this does not include the contained <see cref="Thing"/>s, the contained <see cref="Thing"/>s |
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.
Nitpick: this might be better to start with a capital "T".
CDP4Common/AutoGenPoco/ValueGroup.cs
Outdated
/// </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 |
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.
Nitpick: ContainerLists
is actually a property.
Prerequisites
Description
Added 2 methods on
Thing
class to enable future work on querying referenced things: