public IActionResult DeleteLink([FromQuery] int orderId, [FromQuery] int productId) { var link = _linksRepository.GetLinkByIds(orderId, productId); if (link is null) { return(NotFound()); } _linksRepository.DeleteLink(orderId, productId); return(Ok()); }
public async Task <ActionResult <LinkDto> > DeleteLink(Guid id) { var link = await _repo.GetLinkAsync(id); if (link == null) { return(NotFound()); } _repo.DeleteLink(link); await _repo.SaveChangesAsync(); return(_mapper.Map <LinkDto>(link)); }
public async Task <IActionResult> DeleteLink(Guid id) { var link = await _linksRepo.GetLinkAsync(id); if (link == null) { return(NotFound()); } _linksRepo.DeleteLink(link); await _linksRepo.SaveChangesAsync(); return(NoContent()); }