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)); }
/// <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)); }
public Task <ApiResponse <SolutionLinkDto> > AddSolutionLinkAsync(NewSolutionLinkDto dto) { return(PostAsync <NewSolutionLinkDto, ApiResponse <SolutionLinkDto> >(_clientOptions.AddSolutionLinkUrl, dto)); }
public async Task <IActionResult> AddSolutionLinkAsync([FromBody] NewSolutionLinkDto link) { var result = await _solutionService.AddSolutionLink(link); return(ApiResult(result)); }