so I have a list of numbers and color values.
[1, Red]
[4, Yellow]
[5, Red]
[6, Yellow]
[8, White]
[9, Red]
[10, Yellow]
[13, White]
etc. etc.
The dictionary ints are originally generated randomly within a range between 1 - 100 using Enumerable. var lstNumbers = Enumerable
.Range(1, 100).OrderBy(n => Guid.NewGuid().GetHashCode())
.ToList();
The dictionary is created and used to assign ColorType Values to each of the numbers in Sequence Red, Yellow, White, Red, Yellow, White, etc., etc. to all of the numbers in the list.var map = new Dictionary<int, ColorType>();
I then Remove items a few different ways which brings me to the sorting. I need to sort the final list from this dictionary by value with White results being at the top, Yellow in the middle, and red at the bottom. Red < Yellow < White
Then display.
I figured I could use some if statements for sequencing the colors or maybe setting parameters for each color then use Orderby in a way to sort the results by the color value.
I'm having a hard time figuring out the efficient way of sorting these particular values in this way.
Any ideas?