public async Task <IActionResult> Edit(int id) { var employee = await _repository.GetEmployee(id); if (employee == null) { ViewBag.ErrorMessage = "لايوجد بيانات"; return(View("NotFound")); } ViewData["JopId"] = new SelectList(await _repository.GetJops(), "Id", "Name", employee.JopId); ViewData["UserId"] = new SelectList(await _repository.GetUsers(), "Id", "FullName", employee.UserId); return(View(employee)); }