示例#1
0
        public void Delete(int id)
        {
            var publisher = Get(id);

            if (publisher == null)
            {
                throw new Exception(); // PublisherNotFoundException
            }
            _videoGamesContext.Remove(publisher);
            _videoGamesContext.SaveChanges();
        }
示例#2
0
        public void Delete(int id)
        {
            var genre = Get(id);

            if (genre == null)
            {
                throw new Exception(); // GenreNotFoundException
            }
            _videoGamesContext.Remove(genre);
            _videoGamesContext.SaveChanges();
        }
        /// <summary>
        /// Deletes the VideoGame object at the given id.
        /// </summary>
        /// <param name="id">The id of the video game you want to delete.</param>
        public void Delete(int id)
        {
            var videoGame = Get(id);

            if (videoGame == null)
            {
                throw new Exception();
            }


            _videoGamesContext.Remove(videoGame);
        }
        public void Delete(int id)
        {
            var platform = Get(id);

            if (platform == null)
            {
                throw new Exception();
            }

            _videoGamesContext.Remove(platform);
            _videoGamesContext.SaveChanges();
        }