mam tę strukturę:LINQ GroupBy przełączyć wymiary
var data1 = new Dictionary<int, List<string>>
{
{ 1, new List<string> { "A", "B", "C" } },
{ 2, new List<string> { "B", "C" } }
};
i muszę przekształcić go do tej struktury:
var data2 = new Dictionary<string, List<int>>
{
{ "A", new List<int> { 1 } },
{ "B", new List<int> { 1, 2 } },
{ "C", new List<int> { 1, 2 } }
};
Jak mogę używać LINQ to zrobić? Czy używam GroupBy?
Dzięki