public String export(string searchString) { TicketService tService = new TicketService(); var data = tService.getTickets(searchString).ToList(); string JSONresult; JSONresult = JsonConvert.SerializeObject(data, Formatting.Indented); return(JSONresult); }
public String export(string searchString) { TicketService tService = new TicketService(); var data = tService.getTickets(searchString).ToList(); var serializer = new System.Xml.Serialization.XmlSerializer(data.GetType()); StringWriter textWriter = new StringWriter(); serializer.Serialize(textWriter, data); return(textWriter.ToString()); }