I'm using C# 3.5
and am currently using Linq
to get all users from a user table and put them in a list.
Now I would like to return a random user from that list. What's the best way to go about doing that?
Edit: Found it here: How to get a Random Object using Linq
Like this:
var rand = new Random();
var user = users[rand.Next(users.Count)];