Beispiel #1
0
        public ActionResult LikePlace(Guid placeId)
        {
            var userId = (Guid)Membership.GetUser().ProviderUserKey;

            if (db.bp_Like_GetByUserAndObject(placeId, userId).Count() == 0)
            {
                db.bp_Like_Create(placeId, userId);
            }

            return(RedirectToAction("Details", "Place", new { placeId = placeId }));
        }
Beispiel #2
0
 public static bool IsLike(this HtmlHelper help, Guid userId, Guid objectId)
 {
     using (BestPlaceEntities db = new BestPlaceEntities())
     {
         if (db.bp_Like_GetByUserAndObject(objectId, userId).Count() > 0)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
 }