public ActionResult CreateSubTask([FromBody] CreateSubTaskModel model)
        {
            var response = _workUnit.CreateSubTask(model.Name, model.Description, model.ParentTaskId);

            if (!response.Success)
            {
                return(BadRequest(response));
            }

            return(Ok(response));
        }
Beispiel #2
0
        public async Task <int> Create(CreateSubTaskModel subTask)
        {
            Domain.SubTask newSubTask = new Domain.SubTask
            {
                SubTaskName = subTask.SubTaskName,
                TaskId      = subTask.TaskId,
                StatusId    = 1,
                CreatedDate = DateTime.Now
            };
            _ternContext.SubTasks.Add(newSubTask);
            await _ternContext.SaveChangesAsync();

            return(newSubTask.SubTaskId);
        }
Beispiel #3
0
        public async Task <ActionResult> Create([FromForm] CreateSubTaskModel subTask)
        {
            int subTaskId = await _createSubTask.Create(subTask);

            return(Created(new Uri($"{Request.Path}/{subTaskId}", UriKind.Relative), subTask));;
        }
Beispiel #4
0
 public Task <int> Create(CreateSubTaskModel subTask)
 {
     return(_createSubTaskRepo.Create(subTask));
 }