
Untitled
By: a guest on
Apr 29th, 2012 | syntax:
None | size: 0.55 KB | hits: 13 | expires: Never
public class ServiceStackJsonResult : JsonResult
{
public override void ExecuteResult(ControllerContext context) {
HttpResponseBase response = context.HttpContext.Response;
response.ContentType = !String.IsNullOrEmpty(ContentType) ? ContentType : "application/json";
if (ContentEncoding != null) {
response.ContentEncoding = ContentEncoding;
}
if (Data != null) {
response.Write(JsonSerializer.SerializeToString(Data));
}
}
}