返回响应时, DELETE HTTP 操作的正确返回类型是什么?NoContent
[HttpDelete]
[ProducesResponseType(StatusCodes.Status204NoContent, Type = typeof(User))]
[ProducesResponseType(StatusCodes.Status400BadRequest)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
[Route("{id}")]
public async Task<ActionResult<void>> DeleteUserById(Guid id)
{
return NoContent();
}
当然我不能使用它,因为void不能用作类型。但我也不能用这个
public async void DeleteUserById(Guid id)
{
return NoContent();
}
因为我要退货。