Search Results for

    Show / Hide Table of Contents

    Class JsonResult

    Defines a model for a result of a request that is serialized as JSON using Json.NET.

    Inheritance
    System.Object
    JsonResult
    Implements
    IStatusCodeActionResult
    Namespace: MADE.Web.Mvc.Responses
    Assembly: MADE.Web.Mvc.dll
    Syntax
    public class JsonResult : ActionResult

    Constructors

    | Improve this Doc View Source

    JsonResult(Object, HttpStatusCode, JsonSerializerSettings)

    Initializes a new instance of the JsonResult class with the object to serialize.

    Declaration
    public JsonResult(object value, HttpStatusCode statusCode = null, JsonSerializerSettings serializerSettings = null)
    Parameters
    Type Name Description
    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.

    Properties

    | Improve this Doc View Source

    SerializerSettings

    Gets the Json.Net serializer settings for serializing the result.

    Declaration
    public JsonSerializerSettings SerializerSettings { get; }
    Property Value
    Type Description
    JsonSerializerSettings
    | Improve this Doc View Source

    StatusCode

    Gets the expected result HTTP status code.

    Declaration
    public int? StatusCode { get; }
    Property Value
    Type Description
    System.Nullable<System.Int32>
    | Improve this Doc View Source

    Value

    Gets the value object to serialize.

    Declaration
    public object Value { get; }
    Property Value
    Type Description
    System.Object

    Methods

    | Improve this Doc View Source

    ExecuteResultAsync(ActionContext)

    Executes the result operation of the action method asynchronously writing the Value to the response.

    Declaration
    public override async Task ExecuteResultAsync(ActionContext context)
    Parameters
    Type Name Description
    ActionContext context

    The context in which the result is executed.

    Returns
    Type Description
    Task

    An asynchronous operation.

    Implements

    IStatusCodeActionResult

    Extension Methods

    ReflectionExtensions.GetPropertyValue<T>(Object, String)
    ReflectionExtensions.GetPropertyNames(Object)
    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright (c) MADE Apps