public async Task <IActionResult> Delete(string id) { if (string.IsNullOrEmpty(id) || string.IsNullOrWhiteSpace(id)) { return(BadRequest(new { message = "The request is invalid", requestId = id })); } var existsDto = await service.GetByIdAsync(id); if (existsDto == null) { return(NotFound(new { message = "The hardware was not found", requestId = id })); } await service.DeleteAsync(id); return(NoContent()); }