コード例 #1
0
 public async Task <IActionResult> Update(PatientBo model)
 {
     try
     {
         service.Update(model);
         return(Ok());
     }
     catch (Exception)
     {
         throw;
     }
 }
コード例 #2
0
 public async Task <IActionResult> Post([FromBody] PatientBo model)
 {
     try
     {
         service.Create(model);
         return(Ok());
     }
     catch (Exception)
     {
         throw;
     }
 }
コード例 #3
0
 public async void Update(PatientBo model)
 {
     try
     {
         var @patient = new Patient().Create(model.Id, model.FirstName, model.LastName, model.PhoneNo
                                             , model.ImageUrl, model.Email, model.Address, model.Gender);
         var result = await _context.PatientRepository.CreateAndSave(@patient);
     }
     catch (Exception)
     {
         throw;
     }
 }
コード例 #4
0
        public async void Create(PatientBo model)
        {
            try
            {
                var userModel = new User().Create(model.Email, Enums.UserRoles.Patient);
                var @user     = await Register(userModel, model.Password);

                var @patient = new Patient().Create(@user.Id, model.FirstName, model.LastName, model.PhoneNo
                                                    , model.ImageUrl, model.Email, model.Address, model.Gender).AddUser(@user);

                var result = await _context.PatientRepository.CreateAndSave(@patient);
            }
            catch (Exception ex)
            {
                throw;
            }
        }