public async Task <ActionResult <HomeTask> > Post(HomeTask homeTask) { if (homeTask == null) { return(BadRequest()); } var newTask = await _taskService.AddTask(homeTask); await _hubContext.Clients.All.SendAsync("addTaskHandle"); return(Ok(newTask)); }
public async Task <ActionResult <HomeTask> > Put(HomeTask homeTask) { if (homeTask == null) { return(BadRequest()); } if (!_taskService.ExistById(homeTask.Id)) { return(NotFound()); } var t = await _taskService.UpdateTask(homeTask); await _hubContext.Clients.All.SendAsync("changeTaskHandle"); return(Ok(t)); }