Ejemplo n.º 1
0
        public async Task <IActionResult> PutVideoGames(int id, VideoGames videoGames)
        {
            if (id != videoGames.VideoGameId)
            {
                return(BadRequest());
            }

            _context.Entry(videoGames).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!VideoGamesExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> PutPublishers(int id, Publishers publishers)
        {
            if (id != publishers.PublisherId)
            {
                return(BadRequest());
            }

            _context.Entry(publishers).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!PublishersExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }