public IActionResult AddDoctor([FromBody] NewDoctorRequest newDoctorRequest) { var modifiedEntries = _dbService.AddDoctor(newDoctorRequest); if (modifiedEntries == 0) { return(BadRequest("No entries were modified, probably wrong ID was requested.")); } return(Ok($"{modifiedEntries} entries changed.")); }
public int AddDoctor(NewDoctorRequest newNewDoctorRequest) { var newDoctor = new Doctor { FirstName = newNewDoctorRequest.FirstName, LastName = newNewDoctorRequest.LastName, Email = newNewDoctorRequest.Email }; _context.Add(newDoctor); return(_context.SaveChanges()); }