public async Task <IActionResult> EditView([FromQuery] EducationModel educationModel) { educationModel.Universities = await Context.University.Select(x => new SelectListItem() { Text = x.Name, Value = x.Id.ToString() }).ToListAsync(); educationModel.ListYears(); return(View(educationModel)); }
public async Task <IViewComponentResult> InvokeAsync() { var Model = new EducationModel(); Model.ListYears(); Model.Universities = await Context.University.Select(x => new SelectListItem() { Text = x.Name, Value = x.Id.ToString() }).ToListAsync(); return(View(Model)); }