Aquí hay otra solución sin usar HashSet.
var items = new List<string>() { "one", "one", "two", "one", "two", "zero" };
var uniqueItems = items.Where((item, index) => items.IndexOf(item) == index);
Fue adoptado de este hilo: javascript - Valores únicos en una matriz
Prueba:
using FluentAssertions;
uniqueItems.Count().Should().Be(3);
uniqueItems.Should().BeEquivalentTo("one", "two", "zero");
Prueba de rendimiento para List, HashSety SortedSet. 1 millón de iteraciones:
List: 564 ms
HashSet: 487 ms
SortedSet: 1932 ms
Probar código fuente (esencia)
HashSetperderá el orden de los artículos. Una característica queListproporciona.