public async Task <ShowCathedrasAdminView> ShowCathedras() { List <Company> cathedras = await _companyRepository.GetAll() as List <Company>; ShowCathedrasAdminView result = _cathedraMapper.MapAllCathedrasToViewModel(cathedras); return(result); }
public ShowCathedrasAdminView MapAllCathedrasToViewModel(List <Company> model) { var viewModel = new ShowCathedrasAdminView(); foreach (Company cathedra in model) { var item = new ShowCathedrasAdminViewItem(); item.Id = cathedra.Id; item.Name = cathedra.Name; viewModel.Cathedras.Add(item); } return(viewModel); }
public async Task <IActionResult> ShowCathedras() { ShowCathedrasAdminView result = await _adminService.ShowCathedras(); return(View(viewName: "Cathedras/Cathedras", result)); }