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));
            }
        }
Example #2
0
        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);
        }
Example #3
0
 public async Task UpdateTaskItem(TaskItem taskItem) => await _taskRepo.UpdateTaskItem(taskItem);