So essentially I have a rainbow with Red, Orange, Yellow, Green, Blue, Indigo and Violet. Let's make this an array.
var rainbowArray = new string[] {"red", "orange", "yellow", "green", "blue", "indigo", "violet"};
Now I have a second array that is unordered and comes from the database. This array contains:
var databaseArray = new string[] { "yellow", "red", "indigo" }
How can I order the second array to be in the same order as the first array. We can always assume that the "main" (first) array has all the items that the database will return.