public async Task <IActionResult> Update(PatientBo model) { try { service.Update(model); return(Ok()); } catch (Exception) { throw; } }
public async Task <IActionResult> Post([FromBody] PatientBo model) { try { service.Create(model); return(Ok()); } catch (Exception) { throw; } }
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; } }
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; } }