private async Task <TaskDetails> GetTaskDetails(int id)
        {
            var taskEntity = await _taskManagerRepository.Get(id);

            if (taskEntity == null)
            {
                throw new TaskManagerException(ErrorCodes.TaskNotFoundResponse, "Task not found");
            }

            return(taskEntity);
        }
        public async Task <TaskViewModel> GetTask(int id)
        {
            var taskEntity = await _taskManagerRepository.Get(id);

            if (taskEntity == null)
            {
                throw new TaskDetailsException(ErrorCodes.TaskNotFoundResponse, "Task is empty");
            }

            var taskViewModel = new TaskViewModel()
            {
                TaskName  = taskEntity.TaskName,
                ParentId  = taskEntity.ParentId,
                Priority  = taskEntity.Priority,
                StartDate = taskEntity.StartDate,
                EndDate   = taskEntity.EndDate,
            };

            return(taskViewModel);
        }
Esempio n. 3
0
 public IEnumerable <Task> Get(Filter filter)
 {
     return(_taskManagerRepository.Get(filter));
 }