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; }
public string Serialize(Document doc) { var serializedDoc = JsonConvert.SerializeObject(doc); return serializedDoc; }