I need to create random numbers between 0 and upto 2 so I am using:
//field level
private static Random _random = new Random();
//used in a method
_random.Next(0, 2)
My question is: will the sequence ever repeat / stop been random? Should I recreate (_random = new Random();) every day?
Your code is fine as it is.
You do not need to create a new
Randomobject daily.Note that
Randomis not truly random, but produces a pseudo-random result.