public async Task <IActionResult> OnGet()
        {
            Department = _mapper.Map <DepartmentViewModel>(new Department());

            DepartmentChairSelectList = new SelectList(await _instructorRepository.GetInstructorsAsync(), "Id", "FullName");

            return(Page());
        }
Ejemplo n.º 2
0
 public async Task <IList <Instructor> > GetInstructorsAsync()
 {
     try
     {
         return(await repository.GetInstructorsAsync());
     }
     catch (Exception e)
     {
         throw e;
     }
 }
        public async Task <IActionResult> OnGetAsync(Guid id)
        {
            Department = _mapper.Map <DepartmentViewModel>(await _departmentRepository.GetDepartmentAsync(id));

            if (Department == null)
            {
                return(NotFound());
            }

            DepartmentChairSelectList = new SelectList(await _instructorRepository.GetInstructorsAsync(), "Id", "FullName");

            return(Page());
        }