https://stackoverflow.com/questions/608110/is-it-possible-to-deserialize-xml-into-listt
https://docs.microsoft.com/ru-ru/dotnet/standard/serialization/controlling-xml-serialization-using-attributes
private void Serialize<T>(XDocument doc, List<T> paramList)
{
var serializer = new System.Xml.Serialization.XmlSerializer(paramList.GetType());
var writer = doc.CreateWriter();
serializer.Serialize(writer, paramList);
writer.Close();
}
private List<T> Deserialize<T>(XDocument doc)
{
var serializer = new System.Xml.Serialization.XmlSerializer(typeof(List<T>));
var reader = doc.CreateReader();
var result = (List<T>)serializer.Deserialize(reader);
reader.Close();
return result;
}
https://docs.microsoft.com/ru-ru/dotnet/standard/serialization/examples-of-xml-serialization
https://docs.microsoft.com/ru-ru/dotnet/standard/serialization/controlling-xml-serialization-using-attributes
private void Serialize<T>(XDocument doc, List<T> paramList)
{
var serializer = new System.Xml.Serialization.XmlSerializer(paramList.GetType());
var writer = doc.CreateWriter();
serializer.Serialize(writer, paramList);
writer.Close();
}
private List<T> Deserialize<T>(XDocument doc)
{
var serializer = new System.Xml.Serialization.XmlSerializer(typeof(List<T>));
var reader = doc.CreateReader();
var result = (List<T>)serializer.Deserialize(reader);
reader.Close();
return result;
}
https://docs.microsoft.com/ru-ru/dotnet/standard/serialization/examples-of-xml-serialization
Комментариев нет:
Отправить комментарий