LINQ Getting Unique items from a List within a List
问题 I have a List of type MyObject with a definition below: class MyObject { public string ListName { get; set; } public IEnumerable<OtherObject> ObjectList { get; set;} } Given a List of type MyObject , using LINQ what expression should I use to get all distinct OtherObject ? What I was planning to do was loop each MyObject and get the distinct OtherObject from the ObjectList property, but then I need to get the distinct across the list. Please note that if: MyObject[0].Objectlist[0] == 'ItemA'