Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
j.pavlicek
in reply to: JelteDeJong

Thanks for you reply! I did same assumption - iterate over ComponentDefinition.Occurrences.

 

Could you please help me to understand to this part of code?

.Cast(Of ComponentOccurrence).
Select(Function(occ) occ.ReferencedDocumentDescriptor.ReferencedDocument). Distinct().ToList()

Cast(), Select(), Distinct() and ToList() look like Enumerable Class methods.

 

  • Cast is used here because if we are trying "to extract" items of ComponentDefinition.Occurrences but not using Item Property, it doesn't know about it's type?
  • Select is  using lambda function (for each item "extracted by Cast") which returns ReferencedDocumentDescriptor.ReferencedDocument?
  • Distinct is there to "filter out duplicity"?
  • ToList "packs" all these Documents into a List?

 

 



Inventor 2022, Windows 10 Pro
Sorry for bad English.