Exemple #1
0
        public IActionResult AddLike(int questionId)
        {
            var repo = new QuestionsRepository(_connectionString);
            var user = repo.GetByEmail(User.Identity.Name);
            var like = new Likes()
            {
                UserId     = user.Id,
                QuestionId = questionId
            };

            repo.AddLikes(like);
            return(Json(null));
        }