Пример #1
0
        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));
        }
Пример #2
0
        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());
        }