Exemplo n.º 1
0
        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));
        }
Exemplo n.º 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));
        }