Exemplo n.º 1
0
 public void Update(MovieStudio newMovieStudio)
 {
     _context.Entry(newMovieStudio).State =
         EntityState.Modified;
     _context.Update(newMovieStudio);
     _context.SaveChanges();
 }
Exemplo n.º 2
0
        public async Task <IActionResult> PutReview(int id, Review review)
        {
            if (id != review.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Exemplo n.º 3
0
        public async Task <IActionResult> PutStudio(int id, Studio studio)
        {
            if (id != studio.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
        public void Update(Movie movie)
        {
            _context.Entry(movie).State =
                EntityState.Modified;

            _context.SaveChanges();
        }
        public void Update(MovieTrivia movieTrivia)
        {
            _context.Entry(movieTrivia).State =
                EntityState.Modified;
            _context.Update(movieTrivia);

            _context.SaveChanges();
        }