public async Task <IActionResult> UpdateTodoItem(long id, TodoItemDTO todoItemDto) { if (id != todoItemDto.Id) { return(BadRequest()); } var exists = _itemsService.TodoItemExists(id); if (!exists) { return(NotFound()); } try { await _itemsService.UpdateTodoItem(id, todoItemDto); } catch (DbUpdateConcurrencyException) { return(NotFound()); } return(NoContent()); }