public async System.Threading.Tasks.Task UpdateStatusAsync(TaskForUpdateStatus task) { var currentEntity = Context.Set <Models.Task>().FirstOrDefault(x => x.Id == task.Id); currentEntity.Status = task.Status; await System.Threading.Tasks.Task.Run(() => Context.Update(currentEntity)); }
public async Task <IActionResult> UpdateTaskStatus(long id, TaskForUpdateStatus task) { await _unit.TaskRepository.UpdateStatusAsync(task); if (!await _unit.Commit()) { return(BadRequest("Data wasn`t saved")); } return(Ok()); }