Ejemplo n.º 1
0
        static string ClassToJason(ChinaOpalSearch.SnappsEntity entity)
        {
            DataContractSerializer serializer = new DataContractSerializer(typeof(ChinaOpalSearch.SnappsEntity));

            System.IO.MemoryStream ms = new MemoryStream();
            serializer.WriteObject(ms, entity);
            System.IO.StreamReader reader = new StreamReader(ms);
            ms.Position = 0;
            string strRes = reader.ReadToEnd();

            reader.Close();
            ms.Close();

            return(strRes);
        }