title: Pattern for retrieving data exposed by a WCF service?
body: <p>Are there any suggested patterns for exposing data via a WCF service? I am using netTCP so WCF data services are out. I have a couple of methods that would just normally be overloads but since WCF doesn't support it I have to keep coming up with imaginative names or move methods around between the various service contracts. For example</p>
  
  <pre><code>[ServiceContract]
  public interface IFooService
  {
  
      [ServiceOperation]
      List&lt;Foo&gt; GetFoos ();
  
      [ServiceOperation]
      List&lt;Foo&gt; GetFoosByBar (int barId);
  
      [ServiceOperation]
      List&lt;Foo&gt; GetFoosByBarByBaz (int barId, int baz);
  
      [ServiceOperation]
      List&lt;Foo&gt; GetFoosByBarByBazByQux (int bardId, int baz, string qux);
  }
  </code></pre>
  
  <p>I would much rather have one GetFoos method. Would the practise be to create something like this</p>
  
  <pre><code>[ServiceContract]
  public interface IFooService
  {
      [ServiceOperation]
      List&lt;Foo&gt; GetFoos(FooRequest request);
  }
  
  
  [DataContract]
  public FooRequest
  {
      [DataMember]
      public int? BarId {get;set}
  
      [DataMemeber]
      public int? BazId {get;set}
  
      [DataMember]
      public string Qux {get;set}
  }
  </code></pre>