public async Task <IActionResult> PutMajor(int id, Major major) { if (id != major.Id) { return(BadRequest()); } _context.Entry(major).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MajorExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutEnrolled(int id, Enrolled enrolled) { if (id != enrolled.Id) { return(BadRequest()); } _context.Entry(enrolled).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EnrolledExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }