I'm trying to create a new instance of a custom object inside a for loop, if i add a breakpoint i can see the object and properties changing and it returns x number of DIFFERENT candle objects. However, if i remove the breakpoint all the objects returned in the List are the same. Any ideas?
Thanks
public List<candle> Getcandles(int can)
{
List<candle> dpl = new List<candle>();
for (int i = 0; i < can; i++)
{
candle dp = new candle();
dp.x = new Random().Next(0000, 9999);
dp.y = new Random().Next(0000, 9999);
dpl.Add(dp);
}
return dpl;
}