Ejemplo n.º 1
0
        public AdministratorIndexViewModel Index()
        {
            IEnumerable <Administrator> administrators = _adminDAO.GetAllOrderedBy(x => x.Username);

            AdministratorIndexViewModel viewModel = new AdministratorIndexViewModel();

            foreach (var administrator in administrators)
            {
                string username = UserHelper.CreateUsernameWithoutDomain(administrator.Username);
                viewModel.Administrators.Add(new AdministratorListItemViewModel {
                    Username = username
                });
            }

            return(viewModel);
        }