ControllerBase.ValidationProblem Method

Definition

Overloads

ValidationProblem(ModelStateDictionary)

Creates an ActionResult that produces a Status400BadRequest response with validation errors from modelStateDictionary.

ValidationProblem(ValidationProblemDetails)

Creates an BadRequestObjectResult that produces a Status400BadRequest response.

ValidationProblem()

Creates an ActionResult that produces a Status400BadRequest response with validation errors from ModelState.

ValidationProblem(String, String, Nullable<Int32>, String, String, ModelStateDictionary)

Creates an ActionResult that produces a Status400BadRequest response with a ValidationProblemDetails value.

ValidationProblem(ModelStateDictionary)

Creates an ActionResult that produces a Status400BadRequest response with validation errors from modelStateDictionary.

public:
 virtual Microsoft::AspNetCore::Mvc::ActionResult ^ ValidationProblem(Microsoft::AspNetCore::Mvc::ModelBinding::ModelStateDictionary ^ modelStateDictionary);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.ActionResult ValidationProblem (Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateDictionary modelStateDictionary);
abstract member ValidationProblem : Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateDictionary -> Microsoft.AspNetCore.Mvc.ActionResult
override this.ValidationProblem : Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateDictionary -> Microsoft.AspNetCore.Mvc.ActionResult
Public Overridable Function ValidationProblem (modelStateDictionary As ModelStateDictionary) As ActionResult

Parameters

modelStateDictionary
ModelStateDictionary

The ModelStateDictionary.

Returns

ActionResult

The created BadRequestObjectResult for the response.

Attributes

ValidationProblem(ValidationProblemDetails)

Creates an BadRequestObjectResult that produces a Status400BadRequest response.

public:
 virtual Microsoft::AspNetCore::Mvc::ActionResult ^ ValidationProblem(Microsoft::AspNetCore::Mvc::ValidationProblemDetails ^ descriptor);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.ActionResult ValidationProblem (Microsoft.AspNetCore.Mvc.ValidationProblemDetails descriptor);
abstract member ValidationProblem : Microsoft.AspNetCore.Mvc.ValidationProblemDetails -> Microsoft.AspNetCore.Mvc.ActionResult
override this.ValidationProblem : Microsoft.AspNetCore.Mvc.ValidationProblemDetails -> Microsoft.AspNetCore.Mvc.ActionResult
Public Overridable Function ValidationProblem (descriptor As ValidationProblemDetails) As ActionResult

Parameters

Returns

ActionResult

The created BadRequestObjectResult for the response.

Attributes

ValidationProblem()

Creates an ActionResult that produces a Status400BadRequest response with validation errors from ModelState.

public:
 virtual Microsoft::AspNetCore::Mvc::ActionResult ^ ValidationProblem();
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.ActionResult ValidationProblem ();
abstract member ValidationProblem : unit -> Microsoft.AspNetCore.Mvc.ActionResult
override this.ValidationProblem : unit -> Microsoft.AspNetCore.Mvc.ActionResult
Public Overridable Function ValidationProblem () As ActionResult

Returns

ActionResult

The created ActionResult for the response.

Attributes

ValidationProblem(String, String, Nullable<Int32>, String, String, ModelStateDictionary)

Creates an ActionResult that produces a Status400BadRequest response with a ValidationProblemDetails value.

[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.ActionResult ValidationProblem (string detail = default, string instance = default, int? statusCode = default, string title = default, string type = default, Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateDictionary modelStateDictionary = default);
abstract member ValidationProblem : string * string * Nullable<int> * string * string * Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateDictionary -> Microsoft.AspNetCore.Mvc.ActionResult
override this.ValidationProblem : string * string * Nullable<int> * string * string * Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateDictionary -> Microsoft.AspNetCore.Mvc.ActionResult
Public Overridable Function ValidationProblem (Optional detail As String = null, Optional instance As String = null, Optional statusCode As Nullable(Of Integer) = null, Optional title As String = null, Optional type As String = null, Optional modelStateDictionary As ModelStateDictionary = null) As ActionResult

Parameters

detail
String

The value for Detail.

instance
String

The value for Instance.

statusCode
Nullable<Int32>

The status code.

title
String

The value for Title.

type
String

The value for Type.

modelStateDictionary
ModelStateDictionary

The ModelStateDictionary. When null uses ModelState.

Returns

ActionResult

The created ActionResult for the response.

Attributes

Applies to