예제 #1
0
        private static Document GetDocument(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
        private static string SerializeDocument(Document doc)
        {
            var serializedDoc = JsonConvert.SerializeObject(doc);

            return serializedDoc;
        }