Search Results for

    Show / Hide Table of Contents

    Method BadRequest

    | Improve this Doc View Source

    BadRequest(ModelStateDictionary)

    Represents a validation error that prevents the controller action from completing.

    Declaration
    public static BadRequestObjectResult BadRequest(this ModelStateDictionary modelState)
    Parameters
    Type Name Description
    ModelStateDictionary modelState

    The ModelStateDictionary containing errors to be returned to the client.

    Returns
    Type Description
    BadRequestObjectResult

    An instance of type BadRequestObjectResult that contains an instance of type Result.

    Remarks

    Used in situations where the consumer provides invalid data.

    | Improve this Doc View Source

    BadRequest(ModelStateDictionary, String)

    Represents a validation error that prevents the controller action from completing.

    Declaration
    public static BadRequestObjectResult BadRequest(this ModelStateDictionary modelState, string message)
    Parameters
    Type Name Description
    ModelStateDictionary modelState

    The ModelStateDictionary containing errors to be returned to the client.

    String message

    An error message.

    Returns
    Type Description
    BadRequestObjectResult

    An instance of type BadRequestObjectResult that contains an instance of type Result.

    Remarks

    Used in situations where the consumer provides invalid data.

    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright ©2023 SimpleResults