How do I generate a random integer in C#?
I used below code to have a random number (not recommended):
var random = new Random((int)DateTime.Now.Ticks); var randomValue = random.Next(startValue, endValue + 1);