private static string ToXml(ApiExceptionMessage apiExceptionMessage) { var xml = new XmlSerializer(typeof(ApiExceptionMessage)); using (var writer = new StringWriter()) { xml.Serialize(writer, apiExceptionMessage); return(writer.ToString()); } }
/// <summary> /// Serialized version of ApiExceptionMessage in JSON. /// </summary> /// <returns>string.</returns> private static string ToJson(ApiExceptionMessage apiExceptionMessage) { return(JsonConvert.SerializeObject(apiExceptionMessage)); }