title: deserialize json base64 binary in .net using DataContractJsonSerializer
body: <p>Hey, I am having a problem deserializing base64 json back into the .net object using wcf datacontract....</p>
  
  <p>I have this to deserialize:</p>
  
  <pre><code>public static T FromJSON&lt;T&gt;( this string json )
  {
      using ( MemoryStream ms = new MemoryStream(ASCIIEncoding.Default.GetBytes(json)) )
      {
          DataContractJsonSerializer ser = new DataContractJsonSerializer(typeof(T));
  
          return (T)ser.ReadObject(ms);
      }
  }
  </code></pre>
  
  <p>and...I have this in my model class...</p>
  
  <pre><code>[DataMember]
  [Column(AutoSync = AutoSync.Always, DbType = "rowversion not null", CanBeNull = false, IsDbGenerated = true, IsVersion = true, UpdateCheck = UpdateCheck.Never)]
  public byte[] timestamp { get; set; }
  </code></pre>
  
  <p>and...I'm passing the json back like so...</p>
  
  <pre><code>[{"id":"1","type":"H","date_issued":"\/Date(1286856000000)\/","date_ceu":"\/Date(1603166400000)\/","current":true,"timestamp":"AAAAAAAAD7M="}]
  </code></pre>
  
  <p>and for some reason it just refuses to simply put that base64 back into the byte[]...there must be some other way to get it to work...</p>
  
  <p>also, fyi I'm using ASP.NET MVC and Html.Hidden(...) which serializes the binary into base64 to begin with....</p>
  
  <p>thanks!</p>