private IEnumerable <dynamic> GetStates(Task task)
        {
            if (task == null)
            {
                throw new PageNotFoundException();
            }

            var states = new List <object>();

            foreach (TaskStatusEnum status in Enum.GetValues(typeof(TaskStatusEnum)))
            {
                states.Add(new { Id = (int)status, Name = _taskService.GetTaskStatusName(status) });
                if (task.Status < status)
                {
                    break;
                }
            }

            states.Reverse();
            return(states);
        }
        public async Task <IActionResult> Create(Task taskViewModel)
        {
            await _taskService.CreateAsync(taskViewModel);

            return(RedirectToAction(nameof(Index)));
        }
        public async Task <IActionResult> Edit(Task taskModel)
        {
            await _taskService.UpdateAsync(taskModel);

            return(RedirectToAction(nameof(Details), new { id = taskModel.Id }));
        }