예제 #1
0
        /// <summary>
        /// Gets the Movie Collection for a movie
        /// </summary>
        /// <param name="movieID"></param>
        /// <returns></returns>
        public MovieCollection GetMovieCollection(int movieID)
        {
            MovieCollectionMap mcm = MovieCollectionMap.Where(o => o.MovieId == movieID).FirstOrDefault();
            MovieCollection    mc  = null;

            if (mcm != null)
            {
                int mcid = mcm.MovieCollectionId;
                mc = MovieCollections.Where(o => o.Id == mcid).FirstOrDefault();
            }
            return(mc);
        }
예제 #2
0
        /// <summary>
        /// Adds or updates a movie collection
        /// if Update only poster and backdrop are updated
        /// </summary>
        /// <param name="name"></param>
        /// <param name="id"></param>
        /// <param name="posterPath"></param>
        /// <param name="backdropPath"></param>
        /// <returns></returns>
        public MovieCollection AddMovieCollection(String name, int id, String posterPath, String backdropPath)
        {
            MovieCollection mc     = new MovieCollection(name, id, posterPath, backdropPath);
            Boolean         result = MovieCollections.Add(mc);

            if (!result)                                                   // Collection already exists and I believe has more than the basic information here
            {
                mc              = MovieCollections.First(o => o.Id == id); // Update things that can be; (Name is part of hash code)
                mc.PosterPath   = posterPath;
                mc.BackdropPath = backdropPath;
            }
            return(mc);
        }