Esempio n. 1
0
        public async Task LikeMovie(string userID, ObjectId movieID)
        {
            System.Diagnostics.Debug.WriteLine(movieID);
            UserInformation user = await GetUserInformation(userID);
            MovieLike newMovieLike = new MovieLike();

            Movie movie = await GetMovie(movieID);

            newMovieLike.Id = movie.ID;
            newMovieLike.Name = movie.Title;
            user.MovieLikes.Add(newMovieLike);

            var update = Builders<UserInformation>.Update.Set(x => x.MovieLikes, user.MovieLikes);
            await Users.UpdateOneAsync(x => x.Id == userID, update);
        }
Esempio n. 2
0
 public List<UserInformation> GetAllUsersWithExceptCurrent(string ID, MovieLike movie)
 {
     return Users.Find(x => x.Id != ID && x.MovieLikes.Contains(movie)).ToListAsync().Result;
 }