XML doc creation via serialization

  • Thread starter Thread starter Bill McCormick
  • Start date Start date
B

Bill McCormick

I have a set of classes that I built under the .NET 2.0 FW that I have
used to deserialize an XML doc into objects. I'm pretty sure I can go
the other way as well, but before I do, I wonder if it would be
worthwhile to use LINQ for this instead. If you have experience using
the LINQ to XML API, please share. Thanks.

Bill
 
Bill said:
I have a set of classes that I built under the .NET 2.0 FW that I have
used to deserialize an XML doc into objects. I'm pretty sure I can go
the other way as well, but before I do, I wonder if it would be
worthwhile to use LINQ for this instead. If you have experience using
the LINQ to XML API, please share. Thanks.

If you already have the classes with the XML
serialization/deserialization attributes then it is one method call to
the Serialize method of an XmlSerializer to get your XML document. I
don't think switching to LINQ improves that so I don't think you get an
advantage using LINQ.
 
I have a set of classes that I built under the .NET 2.0 FW that I have
used to deserialize an XML doc into objects. I'm pretty sure I can go
the other way as well, but before I do, I wonder if it would be
worthwhile to use LINQ for this instead. If you have experience using
the LINQ to XML API, please share. Thanks.

Bill

Hi, Linq To XML is used to do the opposite of what you want. You need
to use XML Serialization, depending of how you did the deserialization
you might end with the same file
 
Back
Top