public async Task <IActionResult> PutWidget(int id, Widget widget) { if (id != widget.Id) { return(BadRequest()); } var result = await _widgetRepository.PutAsync(id, widget); if (result == 0) { return(NotFound()); } return(Ok(result)); }