title: Random behavior differences between C# and Java: the seed
body: <p>I have a Random into a class which aims to generate random sequences in different contexts: this is the result of a porting from Java code.
  In the Java version everything works fine since the java.lang.Random class has the method setSeed, which permits the change of the seed value dynamically.</p>
  
  <pre><code>Random rnd = new Random();
  ...
  rnd.nextInt();
  ...
  rnd.setSeed(seedValue);
  </code></pre>
  
  <p>This generates a consistent result, since each time the seed value is set, the result is random.</p>
  
  <p>Unfortunately in C# the behavior is much different, since the Random class needs the seed to be set at construction:</p>
  
  <pre><code>Random rnd = new Random(seedValue);
  ...
  rnd.Next();
  ...
  </code></pre>
  
  <p>So I have to build a new Random instance each time with the given seed, which in some spare cases generates the same value of a previous call.</p>
  
  <p>Is it a way to set the seed of a Random instance in C# dynamically, without losing the consistency of the instance globally?</p>
  
  <p>Thank you very much!</p>