title: Custom Array Item Name for DTO
body: <p>One of my clients has XML data he wants to send to a service we are creating. A sample message might look like:</p>
  
  <pre><code>&lt;SomeRootElement&gt;
    &lt;Dates&gt;
      &lt;Date&gt;2012-05-20T00:00:00&lt;/Date&gt;
      &lt;Date&gt;2012-05-21T00:00:00&lt;/Date&gt;
    &lt;/Dates&gt;
  &lt;/SomeRootElement&gt;
  </code></pre>
  
  <p>I have a corresponding type defined as a <code>DataContract</code> on my WCF service application:</p>
  
  <pre><code>[DataContract]
  public class SomeRootElement {
      [DataMember]
      public ICollection&lt;DateTime&gt; Dates { get; set; }
  }
  </code></pre>
  
  <p>The trouble is that based on this definition, WCF wants the <code>Dates</code> collection to look like:</p>
  
  <pre><code>&lt;Dates&gt;
    &lt;dateTime&gt;2012-05-20T00:00:00&lt;/dateTime&gt;
    &lt;dateTime&gt;2012-05-21T00:00:00&lt;/dateTime&gt;
  &lt;/Dates&gt;
  </code></pre>
  
  <p>Is there any way to influence the array item's serialized element name?  This used to be easy using XML serialization attributes, but the <code>DataContractSerializer</code> ignores those.</p>