示例#1
0
        public async Task <ActionResult <Movie_Actor> > PostMovie_Actor(Movie_Actor movie_Actor)
        {
            _context.movie_Actors.Add(movie_Actor);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetMovie_Actor", new { id = movie_Actor.id }, movie_Actor));
        }
示例#2
0
        public async Task <IActionResult> PutMovie_Actor(int id, Movie_Actor movie_Actor)
        {
            if (id != movie_Actor.id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }