I am trying to generate a list of all possible product option/value combinations for each product in a catalog. Each product can have a variable number of options, and each option can have a variable number of values.
So, for example say I had a shirt, and the option/values were color (red, yellow, blue), size (s, m, l), and material (cotton, nylon, blend). I want to generate a list that looks like this:
red, s, cotton
red, s, nylon
red, s, blend
red, m, cotton
red, m, nylon
red, m, blend
red, l, cotton
red, l, nylon
red, l, blend
yellow, s, cotton
yellow, s, nylon
yellow, s, blend
yellow, m, cotton
yellow, m, nylon
yellow, m, blend
yellow, l, cotton
yellow, l, nylon
yellow, l, blend
blue, s, cotton
blue, s, nylon
blue, s, blend
blue, m, cotton
blue, m, nylon
blue, m, blend
blue, l, cotton
blue, l, nylon
blue, l, blend
I know that in theory, this could generate a LOT of results, but in practice most of the products only have two or three options with two or three values each.
I'm working in C#, but any kind of code example would be extremely helpful. Thanks very much for any suggestions!