public async Task <IActionResult> Put(string id, [FromBody] TaskItem task) { try { await _taskRepository.UpdateTaskItem(id, task); return(Ok()); } catch (Exception ex) { return(BadRequest(ex.Message)); } }
public ResponseModel <TaskItem> UpdateTaskItem(TaskItem taskItem) { var response = new ResponseModel <TaskItem>(); try { if (taskItem != null) { response.Result = _repository.UpdateTaskItem(taskItem); response.IsSuccessful = true; } } catch (Exception e) { response.ErrorMessage = e.Message; response.IsSuccessful = false; } return(response); }
public async Task UpdateTaskItem(TaskItem taskItem) => await _taskRepo.UpdateTaskItem(taskItem);