예제 #1
0
        private string ConvertToXML(IFileModels file)
        {
            try
            {
                string json = file.ReadFile();

                var xml = JsonConvert.DeserializeXmlNode(json);
                return(xml.OuterXml);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
예제 #2
0
 private string ConvertToJSON(IFileModels file)
 {
     try
     {
         string xml    = file.ReadFile();
         var    xmldoc = new System.Xml.XmlDocument();
         xmldoc.LoadXml(xml);
         return(JsonConvert.SerializeXmlNode(xmldoc));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }