none
Child collection of class RRS feed

  • Question

  • I have a collection of

    Public Class Asset

    which has a property

    <style type="”text/css”">.identifier {color:black !important;}</style>
    Private tags As Tags (This has a public property, it is a List(of )
    

    which is also a collection, if there a way of checking against each child collection for each parent.

    So I want to return the asset which has a tag item matching a set criteria.



    <style type="”text/css”">.identifier {color:black !important;}</style>
    Tuesday, December 13, 2016 2:49 PM

Answers

  • It is fine, found an answer here

    http://stackoverflow.com/questions/18165460/how-to-search-hierarchical-data-with-linq

    • Marked as answer by Darren Rockett Wednesday, December 14, 2016 8:43 AM
    Wednesday, December 14, 2016 8:43 AM

All replies

  • Hi Darren Rockett,

    According to your description and related code, class named Asset has a private property named tags which has a public list property, you want to get the list from asset object.  As we know, the property named tags is private, which we could not access it from a asset instance. please modify it as public.

    Best regards,

    Cole Wu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, December 14, 2016 4:51 AM
    Moderator
  • It was for info, yes it has a public property 

    No, effectively it is a collection of classes, each class has a property which is also a collection of classes - I need a piece of LINQ to check against each main collection > Class > class collection > property of each class 

    • Edited by Darren Rockett Wednesday, December 14, 2016 8:35 AM Further info
    Wednesday, December 14, 2016 8:25 AM
  • It is fine, found an answer here

    http://stackoverflow.com/questions/18165460/how-to-search-hierarchical-data-with-linq

    • Marked as answer by Darren Rockett Wednesday, December 14, 2016 8:43 AM
    Wednesday, December 14, 2016 8:43 AM