private IActionResult ResponseWithExceptionReport(string exceptionCode, string message, string locator) { var xmlDoc = new ExceptionReport(exceptionCode, message, locator).ToXml(); Response.ContentType = MediaTypeNames.Application.Xml; Response.StatusCode = (int)HttpStatusCode.OK; return(File(xmlDoc.ToUTF8ByteArray(), Response.ContentType)); }
private IActionResult ResponseWithNotFoundError(string exceptionCode, string message) { var xmlDoc = new ExceptionReport(exceptionCode, message).ToXml(); Response.ContentType = MediaTypeNames.Text.Xml + "; charset=utf-8"; // TODO: better way? Response.StatusCode = (int)HttpStatusCode.NotFound; // TODO: content-disposition: filename="message.xml" return(File(xmlDoc.ToUTF8ByteArray(), Response.ContentType)); }