ControllerBase.UnprocessableEntity 方法

定义

重载

UnprocessableEntity()

创建一个 UnprocessableEntityResult 生成响应的 Status422UnprocessableEntity

UnprocessableEntity(ModelStateDictionary)

创建一个 UnprocessableEntityObjectResult 生成响应的 Status422UnprocessableEntity

UnprocessableEntity(Object)

创建一个 UnprocessableEntityObjectResult 生成响应的 Status422UnprocessableEntity

UnprocessableEntity()

Source:
ControllerBase.cs
Source:
ControllerBase.cs
Source:
ControllerBase.cs

创建一个 UnprocessableEntityResult 生成响应的 Status422UnprocessableEntity

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

返回

为响应创建的 UnprocessableEntityResult

属性

适用于

UnprocessableEntity(ModelStateDictionary)

Source:
ControllerBase.cs
Source:
ControllerBase.cs
Source:
ControllerBase.cs
public:
 virtual Microsoft::AspNetCore::Mvc::UnprocessableEntityObjectResult ^ UnprocessableEntity(Microsoft::AspNetCore::Mvc::ModelBinding::ModelStateDictionary ^ modelState);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.UnprocessableEntityObjectResult UnprocessableEntity (Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateDictionary modelState);
[<Microsoft.AspNetCore.Mvc.NonAction>]
abstract member UnprocessableEntity : Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateDictionary -> Microsoft.AspNetCore.Mvc.UnprocessableEntityObjectResult
override this.UnprocessableEntity : Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateDictionary -> Microsoft.AspNetCore.Mvc.UnprocessableEntityObjectResult
Public Overridable Function UnprocessableEntity (modelState As ModelStateDictionary) As UnprocessableEntityObjectResult

参数

modelState
ModelStateDictionary

包含 ModelStateDictionary 要返回给客户端的错误。

返回

为响应创建的 UnprocessableEntityObjectResult

属性

适用于

UnprocessableEntity(Object)

Source:
ControllerBase.cs
Source:
ControllerBase.cs
Source:
ControllerBase.cs
public:
 virtual Microsoft::AspNetCore::Mvc::UnprocessableEntityObjectResult ^ UnprocessableEntity(System::Object ^ error);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.UnprocessableEntityObjectResult UnprocessableEntity (object error);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual Microsoft.AspNetCore.Mvc.UnprocessableEntityObjectResult UnprocessableEntity (object? error);
[<Microsoft.AspNetCore.Mvc.NonAction>]
abstract member UnprocessableEntity : obj -> Microsoft.AspNetCore.Mvc.UnprocessableEntityObjectResult
override this.UnprocessableEntity : obj -> Microsoft.AspNetCore.Mvc.UnprocessableEntityObjectResult
Public Overridable Function UnprocessableEntity (error As Object) As UnprocessableEntityObjectResult

参数

error
Object

要返回到客户端的错误对象。

返回

为响应创建的 UnprocessableEntityObjectResult

属性

适用于