Esempio n. 1
0
        public ActionResult LikePicture(int id, int loggedId)
        {
            var pic  = db.Pictures.Find(id);
            var user = db.Users.Find(loggedId);

            pic.Likes.Add(user);
            db.SaveChanges();

            NotificationsController.AddLikeNotification(loggedId, id, pic.UserId);
            return(RedirectToAction($"Details/{id}"));
        }