public async Task <ArticleDTO> AddArticleLike(string id)
        {
            var article = await _articleRepository.AddArticleLike(id);

            var dto = Mapper.Map <Article, ArticleDTO>(article);

            return(dto);
        }
Beispiel #2
0
        public async Task <HttpStatusCode> LikeArticle(int articleId, int userId)
        {
            var responseCode = HttpStatusCode.OK;

            try
            {
                using (_articleRepository)
                {
                    await _articleRepository.AddArticleLike(articleId, userId);
                }
            }
            catch (Exception ex)
            {
                responseCode = HttpStatusCode.InternalServerError;
            }

            return(responseCode);
        }