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));
        }
示例#2
0
        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));
        }