Ejemplo n.º 1
0
        public async Task <IActionResult> UpdateWorkItem(Guid iterationId, Guid id, WorkItemUpdateDto workItem)
        {
            if (!_iterationRepository.IterationExists(iterationId))
            {
                return(NotFound("Iteration Not Found"));
            }


            var workItemFromRepo = await _workItemRepository.GetWorkItem(id);

            if (workItemFromRepo == null)
            {
                return(NotFound("WorkItem Not Found"));
            }

            _mapper.Map(workItem, workItemFromRepo);

            _workItemRepository.UpdateWorkItem(workItemFromRepo);

            return(await saveAndValidateUpdate(id));
        }
Ejemplo n.º 2
0
 private bool IterationExists(Guid id)
 {
     return(_iterationRepository.IterationExists(id));
 }