Exemplo n.º 1
0
        public async Task <IActionResult> AssociateTagWithLink(Guid linkId, TagToAssociate tag)
        {
            var linkEntity = await _linksRepo.GetLinkAsync(linkId);

            var tagEntity = await _tagsRepo.GetTagAsync(tag.TagId);

            if (linkEntity == null || tagEntity == null)
            {
                return(NotFound());
            }
            _linksRepo.AssociateTagWithLink(linkEntity, tagEntity);
            await _linksRepo.SaveChangesAsync();

            return(NoContent());
        }