public async Task <ActionResult <TblInstitute> > PostTblInstitute(TblInstitute tblInstitute) { _context.TblInstitute.Add(tblInstitute); await _context.SaveChangesAsync(); return(CreatedAtAction("GetTblInstitute", new { id = tblInstitute.IdInstitute }, tblInstitute)); }
public async Task <IActionResult> PutTblInstitute(int id, TblInstitute tblInstitute) { if (id != tblInstitute.IdInstitute) { return(BadRequest()); } _context.Entry(tblInstitute).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TblInstituteExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }