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)); }
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); }
public async Task <ActionResult> Create([FromForm] CreateSubTaskModel subTask) { int subTaskId = await _createSubTask.Create(subTask); return(Created(new Uri($"{Request.Path}/{subTaskId}", UriKind.Relative), subTask));; }
public Task <int> Create(CreateSubTaskModel subTask) { return(_createSubTaskRepo.Create(subTask)); }