title: DataMember.Name ignored by WCF JSON serialization?
body: <p>I have a WCF service to which I am adding new endpoints that use idiomatic HTTP+JSON. I bumped into the DateTime formatting issue, and tried to fix it like this:</p>
  
  <pre><code>[DataContract]
  public class PingResponse
  {
      [IgnoreDataMember] public DateTime SystemDateTimeLocal;
      [IgnoreDataMember] public DateTime SystemDateTimeUTC;
      [DataMember] public string Version;
  
      [DataMember(EmitDefaultValue = false, Name = nameof(SystemDateTimeLocal)), EditorBrowsable(EditorBrowsableState.Never)]
      public string SystemDateTimeLocalFormatted
      {
          get =&gt; SystemDateTimeLocal.ToString(Constants.DateTimeFormat);
          set =&gt; SystemDateTimeLocal = DateTime.ParseExact(value, Constants.DateTimeFormat, CultureInfo.InvariantCulture);
      }
  
      [DataMember(EmitDefaultValue = false, Name = nameof(SystemDateTimeUTC)), EditorBrowsable(EditorBrowsableState.Never)]
      public string SystemDateTimeUTCFormatted
      {
          get =&gt; SystemDateTimeUTC.ToString(Constants.DateTimeFormat);
          set =&gt; SystemDateTimeUTC = DateTime.ParseExact(value, Constants.DateTimeFormat, CultureInfo.InvariantCulture);
      }
  }
  </code></pre>
  
  <p>But, the resulting object is serialized with <code>SystemDateTimeLocalFormatted</code> and <code>SystemDateTimeUTCFormatted</code> properties, ignoring the <code>Name</code> on the <code>DataMember</code> attributes. Is there a way to achieve what I want that doesn't involve swapping out the serialization stack? :-P</p>
  
  <hr>
  
  <p>Update: I just copied this type into a test app and explicitly used <code>DataContractJsonSerializer</code> and it did not ignore the <code>Name</code> field -- so I am forced to conclude that the original project is archieving its JSON serialization with a different serializer. I haven't yet looked into identifying which one.</p>