Joutsen  v0.4.1
Static Public Member Functions | List of all members
Joutsen.Web.Mvc.ControllerExtensions Class Reference

A class containing extension methods for ASP.NET MVC System.Web.Mvc.IControllers. More...

Static Public Member Functions

static JsonResult CreateJson (this IController controller, object data)
 Creates a NewtonsoftJsonResult. More...
 
static JsonResult CreateJson (this IController controller, object data, JsonRequestBehavior requestBehavior)
 Creates a NewtonsoftJsonResult. More...
 
static NewtonsoftJsonResult CreateJson (this IController controller, object data, HttpStatusCode httpStatusCode)
 Creates a NewtonsoftJsonResult. More...
 
static HttpStatusCodeResult HttpStatusCode (this IController controller, HttpStatusCode httpStatusCode)
 Creates a new HttpStatusCodeResult with a provided status code. More...
 

Detailed Description

A class containing extension methods for ASP.NET MVC System.Web.Mvc.IControllers.

Since
0.2.0

Member Function Documentation

◆ CreateJson() [1/3]

static JsonResult Joutsen.Web.Mvc.ControllerExtensions.CreateJson ( this IController  controller,
object  data 
)
static

Creates a NewtonsoftJsonResult.

Parameters
controllerthe controller
datathe data to write to the response as a JSON string
Returns
the ActionResult that contains the JSON data

◆ CreateJson() [2/3]

static JsonResult Joutsen.Web.Mvc.ControllerExtensions.CreateJson ( this IController  controller,
object  data,
JsonRequestBehavior  requestBehavior 
)
static

Creates a NewtonsoftJsonResult.

Parameters
controllerthe controller
datathe data to write to the response as a JSON string
requestBehaviorindicates whether HTTP GET requests from the client are allowed
Returns
the ActionResult that contains the JSON data

◆ CreateJson() [3/3]

static NewtonsoftJsonResult Joutsen.Web.Mvc.ControllerExtensions.CreateJson ( this IController  controller,
object  data,
HttpStatusCode  httpStatusCode 
)
static

Creates a NewtonsoftJsonResult.

Parameters
controllerthe controller
datathe data to write to the response as a JSON string
httpStatusCodethe status code that is send with the HTTP response
Returns
the ActionResult that contains the JSON data

◆ HttpStatusCode()

static HttpStatusCodeResult Joutsen.Web.Mvc.ControllerExtensions.HttpStatusCode ( this IController  controller,
HttpStatusCode  httpStatusCode 
)
static

Creates a new HttpStatusCodeResult with a provided status code.

Since
0.4.1