title: How to send list of objects to WCF service?
body: <p>I'm building WCF service and I would like to accept List as a parameter to one of my method.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>[ServiceContract]
  public interface IProductService
  {
      [OperationContract]
      int InsertProducts(List&lt;Product&gt; products);
  }
  
  [DataContract]
  [KnownType(typeof(List&lt;Product&gt;))]
  public class Product
  {
      [DataMember]
      public int ProductId{ get; set; }
  
      [DataMember]
      public string ProductName{ get; set; }
  
      [DataMember]
      public List&lt;Product&gt; Products { get; set; }
  }
  </code></pre>
  
  <p>When I run service it gives me an error. </p>
  
  <p>This operation is not supported in the WCF, because it uses <code>NameSpace.Product[]</code></p>