I am trying to convert the following collection:
Source
"a", "b", {1,2,3}
"d", "f", {1,2,2}
"y", "z", {}
Destination
"a", "b", 1
"a", "b", 2
"a", "b", 3
"d", "f", 1
"d", "f", 2
"d", "f", 2
"y", "z", null
I researched it and believe that the answer lies somewhere with the SelectMany () method , but I may seem.
The problem is similar to: How to select a collection in a collection using LINQ? , which denormalizes the collection but does not show how to include related columns (columns 1 and 2 in my example).
The difference is that I need to include the first two columns, as well as return a row in which there are no entries in the collection.
source
share