Dictionary Extensions

While trying to add items to a dictionary I discovered that there’s no equivalent of the AddRange which is available for lists. This is for good reason as adding a KeyValuePair to a dictionary requires first checking that the given key doesn’t already exist and so is more computationally expensive Read more…

List Shuffling

This is just a simple extension for lists to enable the shuffling of items within it based on the StackOverflow answer here. This relies on System.Random so isn’t as random as it could be but is fine for my purposes.