c# linq random element code example
Example 1: Linq - Random Elements
var rnd = new Random();
var SelectedPost = q.OrderBy(x => rnd.Next()).Take(1);
Example 2: linq pick random element
var rand = new Random();
var user = users[rand.Next(users.Count)];