예제 #1
0
        public Document Parse(string input)
        {
            var xdoc = XDocument.Parse(input);
            var doc = new Document
            {
                Title = xdoc.Root.Element("title").Value,
                Text = xdoc.Root.Element("text").Value
            };

            return doc;
        }
예제 #2
0
        public string Serialize(Document doc)
        {
            var serializedDoc = JsonConvert.SerializeObject(doc);

            return serializedDoc;
        }