I need to take a dictionary with a string key and a list of strings as value and find all combinations that it can make. For example:
var myDictionary = new Dictionary<string, List<string>>
{
{"X", new List<string> {"x", "y", "z"}},
{"Y", new List<string> {"x", "y"}},
{"Z", new List<string> {"a", "b"}}
};
Will translate to:
{X: x, Y: x, Z: a}
{X: x, Y: x, Z: b}
{X: x, Y: y, Z: a}
{X: x, Y: y, Z: b}
{X: y, Y: x, Z: a}
{X: y, Y: x, Z: b}
{X: y, Y: y, Z: a}
{X: y, Y: y, Z: b}
{X: z, Y: x, Z: a}
{X: z, Y: x, Z: b}
{X: z, Y: y, Z: a}
{X: z, Y: y, Z: b}
How can I do this the smartest way?