none
How to Deserialize Complex Promoted Properties for query

    Question

  • I have a workflow that persists to a SQL database.  I promote several properties with this.  One of the properties is a custom class I wrote, so I promote it to a binary column as opposed to a sqlvariant.  I want to be able to query (from within my C# code, not the database itself) the promoted properties table.  I can't for the life of me figure out how to deserialize the class.  I've used the following code, but I get a serialization error:

    private static object DeserializeComplextPromotedProperty(byte[] byteStream)
    {
      using (MemoryStream stream = new MemoryStream(byteStream))
      {
        using (GZipStream gzip = new GZipStream(stream, CompressionMode.Decompress))
        {
          using (XmlDictionaryReader dictionaryReader = XmlDictionaryReader.CreateBinaryReader(stream, XmlDictionaryReaderQuotas.Max))
          {
             return new NetDataContractSerializer().ReadObject(dictionaryReader);
          }
        }
      }
    }
    
    Please help...
    

    Tuesday, February 22, 2011 1:25 PM

Answers

All replies