Xml Deserialize - CSharp System.Xml

CSharp examples for System.Xml:XML Serialization

Description

Xml Deserialize

Demo Code


using System.Xml.Serialization;
using System.Xml;
using System.Text;
using System.Linq;
using System.IO;/*from   w w  w .  j a  v a  2  s  . com*/
using System.Collections.Generic;
using System;

public class Main{
        public static T XmlDeserialize<T>(this Stream stream)
        {
            var serializer = new System.Xml.Serialization.XmlSerializer(typeof(T));
            T theObject = (T)serializer.Deserialize(stream);
            return theObject;
        }
}

Related Tutorials