title: How to perform a binary search on IList<T>?
body: <p>Simple question - given an <code>IList&lt;T&gt;</code> how do you perform a binary search without writing the method yourself and without copying the data to a type with build-in binary search support. My current status is the following.</p>
  <ul>
  <li><code>List&lt;T&gt;.BinarySearch()</code> is not a member of <code>IList&lt;T&gt;</code></li>
  <li>There is no equivalent of the <a href="http://msdn.microsoft.com/en-us/library/system.collections.arraylist.adapter.aspx" rel="noreferrer"><code>ArrayList.Adapter()</code></a> method for <code>List&lt;T&gt;</code></li>
  <li><code>IList&lt;T&gt;</code> does not inherit from <code>IList</code>, hence using <code>ArrayList.Adapter()</code> is not possible</li>
  </ul>
  <p>I tend to believe that is not possible with build-in methods, but I cannot believe that such a basic method is missing from the BCL/FCL.</p>
  <p>If it is not possible, who can give the shortest, fastest, smartest, or most beatiful binary search implementation for <code>IList&lt;T&gt;</code>?</p>
  <p><strong>UPDATE</strong></p>
  <p>We all know that a list must be sorted before using binary search, hence you can assume that it is. But I assume (but did not verify) it is the same problem with sort - how do you sort <code>IList&lt;T&gt;</code>?</p>
  <p><strong>CONCLUSION</strong></p>
  <p>There seems to be no build-in binary search for <code>IList&lt;T&gt;</code>. One can use <code>First()</code> and <code>OrderBy()</code> LINQ methods to search and sort, but it will likly have a performance hit. Implementing it yourself (as an extension method) seems the best you can do.</p>