When I work on the project, I usually run into a problem about flatting data.
Because the original data could in the nested property, I have to get it out.
The following is an example about nested properties, and the requirement is that I must get all OrderDetailNumber.
Finally, I found an easy method that is use SelectMany.
LINQ SelectMany
Projects each element of a sequence to an IEnumerable
1 | using System; |
Output:
1 | OD0001 |