public async Task <ActionResult <Demission> > PostDemission(Demission demission) { _context.demissions.Add(demission); await _context.SaveChangesAsync(); return(CreatedAtAction("GetDemission", new { id = demission.Id }, demission)); }
public async Task <IActionResult> PutDemission(int id, Demission demission) { if (id != demission.Id) { return(BadRequest()); } _context.Entry(demission).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DemissionExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }