public async Task <IActionResult> Delete(int id) { try { var phone = await _service.GetPhoneAsync(id); if (phone == null) { return(NotFound()); } await _service.DeletePhoneItem(phone); return(NoContent()); } catch (Exception) { return(BadRequest(ErrorCode.CouldNotDeleteEntity)); } }