public async Task <IActionResult> PutInstitutionBranch([FromRoute] int id, [FromBody] InstitutionBranch institutionBranch) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != institutionBranch.InstitutionBranchId) { return(BadRequest()); } _context.Entry(institutionBranch).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!InstitutionBranchExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutBookCondition([FromRoute] int id, [FromBody] BookCondition bookCondition) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != bookCondition.BookConditionId) { return(BadRequest()); } _context.Entry(bookCondition).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BookConditionExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutStudyArea([FromRoute] int id, [FromBody] StudyArea studyArea) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != studyArea.StudyAreaId) { return(BadRequest()); } _context.Entry(studyArea).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!StudyAreaExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }