Question

I am generating random numbers between 1 and 100.

This is the code I am using:

var random = new Random();
var list = new List<int>();

for(int i = 0; i < 100; i++)
{
   list.Add(random.Next(1,100));
}

I would expect to get a list of random numbers, but they are all the same. What am I doing wrong?

Looking for a job?
Startup (stealth)
London, UK

JP/Morgan Chase
Dallas, Texas

Groundswell Cloud Solutions
Vancouver, Canada

Microsoft
Seattle


Related
C# Singleton design pattern example
Can I deserialize JSON into a dynamic object in C#?