Class ControllerBaseExtensions
Defines a collection of extensions for MVC
Inheritance
System.Object
ControllerBaseExtensions
Namespace: MADE.Web.Mvc.Extensions
Assembly: MADE.Web.Mvc.dll
Syntax
public static class ControllerBaseExtensions : object
Methods
| Improve this Doc View SourceInternalServerError(ControllerBase, ModelStateDictionary)
Creates an InternalServerErrorObjectResult that produces a
Declaration
public static IActionResult InternalServerError(this ControllerBase controller, ModelStateDictionary modelState)
Parameters
Type | Name | Description |
---|---|---|
ControllerBase | controller | The controller that is performing the response. |
ModelStateDictionary | modelState | The |
Returns
Type | Description |
---|---|
IActionResult | The created |
InternalServerError(ControllerBase, Object)
Creates an InternalServerErrorObjectResult that produces a
Declaration
public static IActionResult InternalServerError(this ControllerBase controller, object responseContent)
Parameters
Type | Name | Description |
---|---|---|
ControllerBase | controller | The controller that is performing the response. |
System.Object | responseContent | An error object to be returned to the client. |
Returns
Type | Description |
---|---|
IActionResult | The created |
Json(ControllerBase, Object, HttpStatusCode, JsonSerializerSettings)
Creates a JsonResult object from the specified value for a controller response.
Declaration
public static IActionResult Json(this ControllerBase controller, object value, HttpStatusCode statusCode = null, JsonSerializerSettings serializerSettings = null)
Parameters
Type | Name | Description |
---|---|---|
ControllerBase | controller | The controller that is performing the response. |
System.Object | value | The value object to serialize. |
HttpStatusCode | statusCode | The expected result HTTP status code. |
JsonSerializerSettings | serializerSettings | The Json.NET serializer settings for serializing the result. |
Returns
Type | Description |
---|---|
IActionResult | The created JsonResult for the response. |