public void DoctorAddPatient(Patient newPatient, string name) { var doctor = _context.Doctors.Where(d => d.UserName == name).FirstOrDefault(); _context.Add(newPatient); _context.DoctorPatients.Add(new DoctorPatient() { Id = doctor.Id, PatientId = newPatient.PatientId }); }
public void AddDoctor(Doctor newDoctor) { _context.Add(newDoctor); }