Answer the question
In order to leave comments, you need to log in
How to shuffle a dictionary of objects?
I thought there was some method like .Suffle() but no, tell me how to shuffle a Dictionary type dictionary so that the pairs are preserved but the order is different?
int out of order, a collection of different non-repeating digits (1,5,7,8,15,18, etc.)...
Answer the question
In order to leave comments, you need to log in
Random rand = new Random();
var shuffledDictionary = originalDictionary.OrderBy(x => rand.Next()).ToDictionary(item => item.Key, item => item.Value);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question