public async Task <ActionResult <DoctoresModel> > PostPaymentDetail(DoctoresModel doctorDetail) { context.Doctores.Add(doctorDetail); await context.SaveChangesAsync(); return(CreatedAtAction("GetPaymentDetail", new { id = doctorDetail.DoctorID }, doctorDetail)); }
public async Task <IActionResult> PutDoctorDetail(int id, DoctoresModel doctor) { if (id != doctor.DoctorID) { return(BadRequest()); } context.Entry(doctor).State = EntityState.Modified; try { await context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DoctorExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }