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)); } }
public int GetLikesCount(Guid imageId) { return(likeDal.GetALL().Where(x => x.ImageId == imageId).Count()); }