Ejemplo n.º 1
0
        public void AddLike(Likes like)
        {
            var ctx = new QuestionsDbContext(_connectionString);

            ctx.Likes.Add(like);
            ctx.SaveChanges();
        }
Ejemplo n.º 2
0
        public void UpdateLikes(int id, User user)
        {
            using var context = new QADbContext(_connectionString);
            var like = new Likes
            {
                QuestionId = id,
                UserId     = user.Id
            };

            context.Likes.Add(like);
            context.SaveChanges();
        }