title: .NET: Get HashSet element using First() or Take()
body: <p>Ok, I am stuck with a .NET beginners problem. I am using C++/CLI so it is a little hard to find code examples. WWW gave me a lot of stuff to read - but no solution.</p>
  
  <p>I am using .NETs HashSet. I tried to take/get a random element of the set. It must not actually be a <strong>random</strong> element, it also may be the first or last. Simply any one element.</p>
  
  <p>There is no method providing this. However the documentation <a href="http://msdn.microsoft.com/en-us/library/bb359438.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/bb359438.aspx</a> lists some so called "Extension methods". One of them that would solve my problem is <code>First()</code>. Alas I have no idea how to use it. I tried <code>myHashSet-&gt;First()</code> and some other rubbish but the compiler tells me it doesn't know that method.</p>
  
  <p>So, please tell me how I can call that First() "Extension Method" on a HashSet using <strong>C++/CLI</strong>. </p>