Esempio n. 1
0
        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());
        }
Esempio n. 2
0
        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));
        }
Esempio n. 3
0
        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());
        }