public async Task <ActionResult <therapist> > Posttherapist(therapist therapist) { _context.Therapists.Add(therapist); await _context.SaveChangesAsync(); return(CreatedAtAction("Gettherapist", new { id = therapist.Id }, therapist)); }
public async Task <IActionResult> Puttherapist(int id, therapist therapist) { if (id != therapist.Id) { return(BadRequest()); } _context.Entry(therapist).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!therapistExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }