Beispiel #1
0
        private static string ToXml(ApiExceptionMessage apiExceptionMessage)
        {
            var xml = new XmlSerializer(typeof(ApiExceptionMessage));

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