Deserialize with XmlSerializer : Xml Serialization « XML « C# / C Sharp






Deserialize with XmlSerializer

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Xml.Serialization;

internal class Util
{
    internal static T Deserialize<T>(Stream s)
    {
        XmlSerializer serializer = new XmlSerializer(typeof(T));
        return (T)serializer.Deserialize(s);
    }
}

   
  








Related examples in the same category

1.Serialize List of Objects
2.Use XmlSerializer
3.Set Xml Attribute when serilzation
4.Use XML Serialization with Custom Objects
5.XmlRootAttribute
6.Takes an XML file and exports the Object it holds
7.Converts an XML string to an object
8.Deserializes/Serializes an xml document back into an object
9.XmlSerializer Util
10.Serilize to Xml
11.Xml Serialization Helper
12.Xml Serialization Helper 2
13.Tiny Xml Serializer
14.Xml Serialization Manager