Maybe I'm doing this incorrectly, but I'm trying to shuffle a List by casting it into a HashSet,
List<Article> art = new List<Article>(rootobject.articles);
HashSet<Article> setart = new HashSet<Article>(art);
When I iterate through both the List,
foreach (Article a in art)
{
Console.WriteLine(a.title)
}
and the Hashset,
foreach (Article a in setart)
{
Console.WriteLine(a.title)
}
I get exactly the same output in exactly the same order. I was thinking that use the cast operation should randomize the List by default but that appears to not be the case.
Where am I going wrong?