public async Task <IActionResult> Edit(string id, DoctorEditInputModel doctorEditInputModel) { if (!ModelState.IsValid) { return(View(doctorEditInputModel)); } DoctorServiceModel doctorServiceModel = AutoMapper.Mapper.Map <DoctorServiceModel>(doctorEditInputModel); await doctorService.Edit(id, doctorServiceModel); return(Redirect("/Doctor/All")); }
public async Task <IActionResult> Edit(string id) { DoctorEditInputModel doctorEditInputModel = (await doctorService.GetById(id) ).To <DoctorEditInputModel>(); if (doctorEditInputModel == null) { return(Redirect("/Doctor/All")); } await GetAllDepartments(); return(View(doctorEditInputModel)); }