예제 #1
0
        public async Task <ProductTagResponse> AssingProductTagAsync(int ptoductId, int tagId)
        {
            try
            {
                await _productTagRepository.AssingProductTag(ptoductId, tagId);

                await _unitOfWork.CompleteAsync();

                ProductTag productTag = await _productTagRepository.FindByProductIdAndTagId(ptoductId, tagId);

                return(new ProductTagResponse(productTag));
            }
            catch (Exception e)
            {
                return(new ProductTagResponse($"An error ocurred while assinging Tag to Product: {e.Message}"));
            }
        }