Esempio n. 1
0
        public void RemoveLike(ApplicationUser user)
        {
            // 1. check lecture
            var like = Likes.SingleOrDefault(l => l.UserId == user.Id);

            if (like == null)
            {
                throw new NotFoundException("like not found");
            }
            // 2. remove like
            var likeList = Likes.ToList();

            likeList.Remove(like);
            Likes = likeList;
        }