Esempio n. 1
0
 public bool LiceImage(Guid userId, Guid imageId)
 {
     if (likeDal.GetALL().FirstOrDefault(x => x.UserId == userId && x.ImageId == imageId) == null)
     {
         return(likeDal.Add(new LikeImage {
             UserId = userId, ImageId = imageId
         }));
     }
     else
     {
         return(likeDal.Remove(userId, imageId));
     }
 }
Esempio n. 2
0
 public int GetLikesCount(Guid imageId)
 {
     return(likeDal.GetALL().Where(x => x.ImageId == imageId).Count());
 }