ListExtensions

ListExtensions is a public static class in the Extensions Namespace. It contains extension methods for the List class.

AddUnlessDuplicate
This adds an item to a List if and only if the item is not already contained within the list. This avoids duplicate items in the list. This is an O(n + 1) operation, meaning that the method will take more time if the list is larger.