示例#1
0
        public void AddDoctor(AddOrUpdateDoctorRequest req)
        {
            var addedDoctor = _context.Add(new Doctor {
                FirstName = req.FirstName, LastName = req.LastName, Email = req.Email
            });

            _context.SaveChanges();
        }
示例#2
0
        public void UpdateDoctor(AddOrUpdateDoctorRequest req, int id)
        {
            var doctor = _context.Doctor.Find(id);

            if (doctor == null)
            {
                return;
            }

            _context.Entry(doctor).CurrentValues.SetValues(req);
            _context.SaveChanges();
        }
示例#3
0
 public IActionResult UpdateDoctor(AddOrUpdateDoctorRequest req, int id)
 {
     _service.UpdateDoctor(req, id);
     return(Ok());
 }
示例#4
0
 public IActionResult AddDoctor(AddOrUpdateDoctorRequest req)
 {
     _service.AddDoctor(req);
     return(Ok());
 }