Esempio n. 1
0
        public ActionResult Create(Like q)

        {
            q.likes    = 1;
            q.Dislikes = 0;


            Cs.Add(q);
            Cs.Commit();
            return(RedirectToAction("Index"));
        }
Esempio n. 2
0
        public ActionResult Create(LikesViewModel lvm, int idp)
        {
            Likes like = new Likes();

            like.IdParticipant = int.Parse(User.Identity.GetUserId());
            like.LikedDate     = DateTime.Now;

            like.IdPost = idp;
            LS.Add(like);
            LS.Commit();


            return(RedirectToAction("../Post/Details"));
        }