public async Task <ActionResult <Sekce> > PostSekce(Sekce sekce) { _context.Sekce.Add(sekce); await _context.SaveChangesAsync(); return(CreatedAtAction("GetSekce", new { id = sekce.Id }, sekce)); }
public async Task <IActionResult> PutSekce(long id, Sekce sekce) { if (id != sekce.Id) { return(BadRequest()); } _context.Entry(sekce).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SekceExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }