Exemplo n.º 1
0
        public async Task <ShowCathedrasAdminView> ShowCathedras()
        {
            List <Company> cathedras = await _companyRepository.GetAll() as List <Company>;

            ShowCathedrasAdminView result = _cathedraMapper.MapAllCathedrasToViewModel(cathedras);

            return(result);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        public async Task <IActionResult> ShowCathedras()
        {
            ShowCathedrasAdminView result = await _adminService.ShowCathedras();

            return(View(viewName: "Cathedras/Cathedras", result));
        }