public async Task Add(TaskViewModel taskViewModel)
        {
            if (taskViewModel.IsParentTask)
            {
                await AddParentTask(taskViewModel);
            }
            else
            {
                var taskEntity = _mapper.Map <TaskDetails>(taskViewModel);

                taskEntity.ParentTask = await GetParentTask(taskViewModel);

                taskEntity.Project = await GetProject(taskViewModel);

                taskEntity.User = await GetUser(taskViewModel);

                await _taskManagerRepository.Add(taskEntity);
            }
        }
        public async Task AddTask(TaskViewModel taskDetails)
        {
            if (taskDetails == null)
            {
                throw new TaskDetailsException(ErrorCodes.TaskBadRequestResponse, "Task is empty");
            }

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

            await _taskManagerRepository.Add(taskEntity);
        }
Exemple #3
0
 public void Add(Task task)
 {
     _taskManagerRepository.Add(task);
 }