public async Task <ActionResult <DeansOffice> > PostDeansOffice(DeansOffice deansOffice) { _context.DeansOffices.Add(deansOffice); await _context.SaveChangesAsync(); return(CreatedAtAction("GetDeansOffice", new { id = deansOffice.Id }, deansOffice)); }
public async Task <IActionResult> PutDeansOffice(Guid id, DeansOffice deansOffice) { if (id != deansOffice.Id) { return(BadRequest()); } _context.Entry(deansOffice).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DeansOfficeExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }