public async Task <IActionResult> OnGet(int id) { try { var trainer = await _trainerService.GetTrainerById(id); if (trainer == null) { return(NotFound()); } Input = new InputModel() { TrainerId = trainer.TrainerId, Address1 = trainer.Address1, Address2 = trainer.Address2, FullName = trainer.FullName, Email = trainer.Email, PhoneHome = trainer.PhoneHome, PhoneMobile = trainer.PhoneMobile, Specialization = trainer.Specialization }; return(Page()); } catch (Exception ex) { throw new Exception(ex.Message); } }
public IActionResult TrainerEdit(int trainerId) { TrainerEditViewModel trainerEditViewModel = new TrainerEditViewModel() { Trainer = _trainerService.GetTrainerById(trainerId), }; return(View(trainerEditViewModel)); }
public IActionResult GetTrainer(long id) { var trainer = _trainerService.GetTrainerById(id); if (trainer == null) { return(NotFound()); } return(Ok(trainer)); }
public async Task <IActionResult> OnGet(int id) { var trainer = await _trainerService.GetTrainerById(id, includeDetails : true); Input = new InputModel() { FullName = trainer.FullName, Email = trainer.Email, PhoneHome = trainer.PhoneHome, PhoneMobile = trainer.PhoneMobile, Address1 = trainer.Address1, Address2 = trainer.Address2 }; return(Page()); }