I have several objects in a class from an xsd file and I have the following object to give an example:
FacturaElectronicaResumenFactura resumen = new
FacturaElectronicaResumenFactura()
{
CodigoMoneda = FacturaElectronicaResumenFacturaCodigoMoneda.CRC,
TipoCambio = 1m,
TotalServExentos = 1m,
TotalMercanciasGravadas = 1m,
TotalMercanciasExentas = 2000m,
TotalGravado = 1m,
TotalExento = 2000m,
TotalVenta = 2000m,
TotalDescuentos = 1m,
TotalVentaNeta = 2000m,
TotalImpuesto = 1m,
TotalComprobante = 2000m
};
And I want to save it in an xml for which I have the following code:
XmlSerializer serial = new XmlSerializer(typeof(FacturaElectronica));
var ruta =
Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) +
"//SerializationOverview.xml";
System.IO.FileStream file = System.IO.File.Create(ruta);
serial.Serialize(file,fe);
file.Close();
but when I open the xml to review, some data or properties defined in the invoice class are not saved. Because you are not saving all the properties of the object in the xml file, any ideas ???