public void OnGet() { var faculties = _facultyAppService.GetAllSelection(); var allFaculties = faculties.Select(item => new SelectListItem() { Text = item.Name, Value = item.Id.ToString() }); ViewData.Add("allFaculties", SerializeObject(allFaculties)); }
public async Task OnGetAsync() { Faculties = _facultyAppService.GetAllSelection().Select(item => new SelectListItem() { Value = item.Id.ToString(), Text = $"{item.Id} - {item.Name}" }).ToList(); var majorDto = await _majorAppService.GetAsync(Id); Major = ObjectMapper.Map <MajorDto, MajorFormModel>(majorDto); }