Search Results for

    Show / Hide Table of Contents

    Class ControllerBaseExtensions

    Defines a collection of extensions for MVC instances.

    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 Source

    InternalServerError(ControllerBase, ModelStateDictionary)

    Creates an InternalServerErrorObjectResult that produces a response.

    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 containing errors to be returned to the client.

    Returns
    Type Description
    IActionResult

    The created for the response.

    | Improve this Doc View Source

    InternalServerError(ControllerBase, Object)

    Creates an InternalServerErrorObjectResult that produces a response.

    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 for the response.

    | Improve this Doc View Source

    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.

    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright (c) MADE Apps