Esempio n. 1
0
        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));
        }
Esempio n. 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);
        }
Esempio n. 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));;
        }
Esempio n. 4
0
 public Task <int> Create(CreateSubTaskModel subTask)
 {
     return(_createSubTaskRepo.Create(subTask));
 }