The problem with one Random is that you can pass it (directly or indirectly via asynchronous code / callbacks) to multiple threads. And since Random not thread safe, you will need to trust this code for synchronization. If you cannot trust the code, write a wrapper around Random that synchronizes for you, or can use an instance of [ThreadStatic] / ThreadLocal<T> .
Note also that random is not exactly the same as unique ...
However, if you declare it in a method, then any hard loop practically guarantees the same value for each iteration of the loop - for example,
foreach(var foo in foos) foo.SomeMethod();
if SomeMethod starts a Random , you will most likely see duplicate values.
source share