public async Task <ActionResult <Prlist> > PostPrlist(Prlist prlist) { _context.Prlists.Add(prlist); await _context.SaveChangesAsync(); return(CreatedAtAction("GetPrlist", new { id = prlist.Id }, prlist)); }
public async Task <IActionResult> PutPrlist(int id, Prlist prlist) { if (id != prlist.Id) { return(BadRequest()); } _context.Entry(prlist).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PrlistExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }