title: Repository pattern - too many methods
body: <p>I often see example repository patterns that look like this:</p>
  
  <pre><code>public interface IRepository&lt;T&gt;
  {
      T GetById(int id);
      IEnumerable&lt;T&gt; GetAllByName(string name);
  }
  </code></pre>
  
  <p>But how do you handle cases where you may need to do a complex search?  I don't think it would be a good idea to add many methods to the interface that would make it end up looking like:</p>
  
  <pre><code>IEnumerable&lt;T&gt; GetAllByFirstName(string name);
  IEnumerable&lt;T&gt; GetAllByLastName(string name);
  IEnumerable&lt;T&gt; GetAllByFirstAndLastName(string name);
  IEnumerable&lt;T&gt; GetAllByAddress(string name);
  ...
  ...
  ...
  </code></pre>