public async Task <ActionResult <CareGiverDetails> > PostCareGiverDetails(CareGiverDetails careGiverDetails) { _context.CareGiversDetails.Add(careGiverDetails); await _context.SaveChangesAsync(); return(CreatedAtAction("GetCareGiverDetails", new { id = careGiverDetails.ID }, careGiverDetails)); }
public async Task <IActionResult> PutCareGiverDetails(int id, CareGiverDetails careGiverDetails) { if (id != careGiverDetails.ID) { return(BadRequest()); } _context.Entry(careGiverDetails).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CareGiverDetailsExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }