示例#1
0
        public async Task <IActionResult> PutProductMovieGenre(Guid id, ProductMovieGenre productMovieGenre)
        {
            if (id != productMovieGenre.Id)
            {
                return(BadRequest());
            }

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

            ChangeLog.AddUpdatedLog(_context, "MovieGenres", productMovieGenre);

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

            return(NoContent());
        }
示例#2
0
        public async Task <ActionResult <ProductMovieGenre> > PostProductMovieGenre(ProductMovieGenre productMovieGenre)
        {
            _context.ProductMovieGenres.Add(productMovieGenre);

            ChangeLog.AddCreatedLog(_context, "MovieGenres", productMovieGenre);

            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetProductMovieGenre", new { id = productMovieGenre.Id }, productMovieGenre));
        }