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've researched it, and think that the answer lies somewhere with the SelectMany() method but I can seem to pin down the answer.
The problem is similar to: How do I select a collection within a collection using LINQ? which denormalises the collection but it doesn't show how to include the related columns (columns 1 and 2 in my example).
The difference is that I need to include the first two columns and also return a row where there are no entries in the collection.