I want to merge the values of multiple dictionaries (3 to be exact) into a list. My current solution uses linq to first combine the dictionaries and then converts the values into a list.
private List<Part> AllParts()
{
return walls.Concat(floors)
.Concat(columns)
.ToDictionary(kvp => kvp.Key, kvp => kvp.Value)
.Values
.ToList();
}
Merging the lists first seems redundant. How can I improve this?