Example #1
0
 private Response BuildXmlResponse(IEnumerable <TransactionEvent> transactionEvents)
 {
     return(new Response
     {
         StatusCode = HttpStatusCode.OK,
         ContentType = "application/xml",
         Contents = stream =>
         {
             XmlLog.Write(transactionEvents, stream);
             stream.Flush();
             stream.Close();
         },
     });
 }
Example #2
0
        private Response BuildFileDownloadResponse(string fileName, IEnumerable <TransactionEvent> transactionEvents)
        {
            var response = new Response();

            response.Headers.Add("Content-Disposition", String.Format(CultureInfo.InvariantCulture,
                                                                      "attachment; filename={0}", fileName));
            response.ContentType = "application/xml";
            response.Contents    = stream =>
            {
                XmlLog.Write(transactionEvents, stream);
                stream.Flush();
                stream.Close();
            };

            return(response);
        }