Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 29th, 2012  |  syntax: None  |  size: 0.55 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.     public class ServiceStackJsonResult : JsonResult
  2.     {
  3.         public override void ExecuteResult(ControllerContext context) {
  4.             HttpResponseBase response = context.HttpContext.Response;
  5.             response.ContentType = !String.IsNullOrEmpty(ContentType) ? ContentType : "application/json";
  6.  
  7.             if (ContentEncoding != null) {
  8.                 response.ContentEncoding = ContentEncoding;
  9.             }
  10.  
  11.             if (Data != null) {
  12.                 response.Write(JsonSerializer.SerializeToString(Data));
  13.             }
  14.         }
  15.     }