ControllerBase.UnprocessableEntity 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
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 。
- 属性