Пример #1
0
        public async Task <IEnumerable <AssignmentResponseDto> > RetrieveAll(string projectGuid)
        {
            _logger.LogInfo("Retrieving all existing assignments from database ...");

            var assignments = await _assignmentRepository.FindAssignments(Utils.checkGuidFormat(projectGuid));

            if (assignments.Count() == 0)
            {
                throw new EntityNotFoundException($"{DomainConsts.ENTITY_ASSIGNMENT} with id: {projectGuid} not found.", DomainConsts.APPLICATION_NAME);
            }

            return(_mapper.Map <IEnumerable <Assignment>, IEnumerable <AssignmentResponseDto> >(assignments));
        }