Ancestry.QueryProcessor.Service.JsonNetResult.ExecuteResult C# (CSharp) Method

ExecuteResult() public method

public ExecuteResult ( System.Web.Mvc.ControllerContext context ) : void
context System.Web.Mvc.ControllerContext
return void
        public override void ExecuteResult(ControllerContext context)
        {
            if (context == null)
                throw new ArgumentNullException("context");

            var response = context.HttpContext.Response;

            response.ContentType = !String.IsNullOrEmpty(ContentType) ? ContentType : "application/json";

            if (ContentEncoding != null)
                response.ContentEncoding = ContentEncoding;

            if (Data == null)
                return;

            // If you need special handling, you can call another form of SerializeObject below
            var serializedObject = JsonConvert.SerializeObject(Data, Formatting.Indented);
            response.Write(serializedObject);
        }
JsonNetResult