public async Task <IActionResult> PutRoaster([FromRoute] int id, [FromBody] RoasterOfDoctor roaster) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != roaster.RoasterOfDoctorId) { return(BadRequest()); } try { _repo.Update(roaster); var save = await _repo.SaveAsync(roaster); } catch (DbUpdateConcurrencyException) { if (!RoasterExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult> PostPateint([FromBody] Chamber chamber) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _repo.Add(chamber); var save = await _repo.SaveAsync(chamber); return(CreatedAtAction("GetChambers", new { id = chamber.ChamberId }, chamber)); }
public async Task <ActionResult> PostPateint([FromBody] Pateint pateint) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _repo.Add(pateint); var save = await _repo.SaveAsync(pateint); return(CreatedAtAction("GetPateints", new { id = pateint.PateintId }, pateint)); }
public async Task <ActionResult> PostDeasisHistories([FromBody] DeasisHistory deasisHistory) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _repo.Add(deasisHistory); var save = await _repo.SaveAsync(deasisHistory); return(CreatedAtAction("GetDeasisHistories", new { id = deasisHistory.DeasisHistoryId }, deasisHistory)); }
public async Task <ActionResult> PostSpecialization([FromBody] Speacialization specialization) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _repo.Add(specialization); var save = await _repo.SaveAsync(specialization); return(CreatedAtAction("GetSpeacializations", new { id = specialization.SpeacializationId }, specialization)); }
public async Task <ActionResult> PostDoctors([FromBody] Doctor doctor) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _repo.Add(doctor); var save = await _repo.SaveAsync(doctor); return(CreatedAtAction("GetDoctors", new { id = doctor.DoctorId }, doctor)); }