public async Task <ActionResult <Instituiton> > PostInstituiton(Instituiton instituiton) { _context.Instituitons.Add(instituiton); await _context.SaveChangesAsync(); return(CreatedAtAction("GetInstituiton", new { id = instituiton.Id }, instituiton)); }
public async Task <IActionResult> PutInstituiton(int id, Instituiton instituiton) { if (id != instituiton.Id) { return(BadRequest()); } _context.Entry(instituiton).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!InstituitonExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }