Example #1
0
        public async Task <ActionResult <TVShow_TRP> > PostTVShow_TRP(TVShow_TRP tVShow_TRP)
        {
            _context.TVShow_TRP.Add(tVShow_TRP);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetTVShow_TRP", new { id = tVShow_TRP.Id }, tVShow_TRP));
        }
Example #2
0
        public async Task <IActionResult> PutTVShow_TRP(int id, TVShow_TRP tVShow_TRP)
        {
            if (id != tVShow_TRP.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }