public IActionResult Get([FromBody] ChallengeSelectionIdeaDto challengeSelectionIdeaDto) { try { challengeSelectionIdeaDto = _ideaStatusService.GetSelectionIdea(challengeSelectionIdeaDto); _unitOfWork.Commit(); return(Ok(challengeSelectionIdeaDto)); } catch (Exception e) { return(BadRequest(e.Message)); } }
public FilterIdeaDto GetFilterIdea(Guid challengeId) { var selectionFilterDto = new ChallengeSelectionFilterDto { ChallengeId = challengeId }; var selectionIdeaDto = new ChallengeSelectionIdeaDto { ChallengeId = challengeId }; var challengeSelectionFilterDto = _filterStatusService.GetSelectionFilter(selectionFilterDto); var challengeSelectionIdeaDto = _ideaStatusService.GetSelectionIdea(selectionIdeaDto); var filterIdeaDto = new FilterIdeaDto { ChallengeId = challengeId, FilterPasseds = new List <FilterPassedDto>() }; foreach (var filter in challengeSelectionFilterDto.Keep) { var tmpFilter = new Filter { Id = filter.Id, Title = filter.Title, Description = filter.Description }; var filterPassedDto = new FilterPassedDto { Filter = tmpFilter, Ideas = challengeSelectionIdeaDto.Keep.Select(x => new Idea { Id = x.Id, Title = x.Title, Description = x.Description }).ToList() }; filterIdeaDto.FilterPasseds.Add(filterPassedDto); } return(filterIdeaDto); }