title: While Loop with assignment in C# Linq
body: <p>I'd like to assign the variable <code>vStreamID</code> with a random number. This number should be newly generated as long as my dictionary <code>md_StreamDict</code> contains the generated number.</p>
  
  <p>Long version:</p>
  
  <pre><code>vStreamID = (new Random()).Next(1000, 9999).ToString();
  while (md_StreamDict.ContainsKey(vStreamID)) {
      vStreamID = (new Random()).Next(1000, 9999).ToString();
  }
  </code></pre>
  
  <p>I would like to see something LINQ style</p>
  
  <pre><code>md_StreamDict.ContainsKey(vStreamID)
      .while( x =&gt; x = (new Random())
      .Next(1000, 9999)
      .ToString();
  </code></pre>
  
  <p>I know the example above is bananas. But I would be happy if there's a real way to achieve this. And no, we're not starting the usual discussion about readability again. ;)</p>