Пример #1
0
        public async Task <IActionResult> AddLink(NewSolutionLinkDto dto)
        {
            var response = await _solutionApiClient.AddSolutionLinkAsync(dto);

            var solution = await _solutionApiClient.GetByFilterAsync(new SolutionFilter { SolutionId = dto.SolutionId });

            ViewBag.Links = solution.Data.FirstOrDefault().SolutionLinks;
            return(View(dto));
        }
Пример #2
0
        /// <summary>
        /// Добавление ссылок от разработчика для решения
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        public async Task <SolutionLinkDto> AddSolutionLink(NewSolutionLinkDto dto)
        {
            var sol = await _solutionRepository.GetAsync(dto.SolutionId);

            var link = _mapper.Map <SolutionLink>(dto);

            sol.SolutionLinks.Add(link);
            await _solutionRepository.SaveChangesAsync();

            return(_mapper.Map <SolutionLinkDto>(link));
        }
Пример #3
0
 public Task <ApiResponse <SolutionLinkDto> > AddSolutionLinkAsync(NewSolutionLinkDto dto)
 {
     return(PostAsync <NewSolutionLinkDto, ApiResponse <SolutionLinkDto> >(_clientOptions.AddSolutionLinkUrl, dto));
 }
Пример #4
0
        public async Task <IActionResult> AddSolutionLinkAsync([FromBody] NewSolutionLinkDto link)
        {
            var result = await _solutionService.AddSolutionLink(link);

            return(ApiResult(result));
        }