Beispiel #1
0
        public AllAccountsViewModel GetAllUsers()
        {
            IEnumerable <User> allAccounts = this.Context.Users.OrderBy(u => u.UserName).ToList();

            var result = new AllAccountsViewModel
            {
                Users = allAccounts
            };

            return(result);
        }
Beispiel #2
0
        public IActionResult GetAll()
        {
            if (this.User.FindFirstValue(ClaimTypes.NameIdentifier) == null)
            {
                return(this.RedirectToAction("Login", "Account", new { Area = "Identity" }));
            }

            var viewModel = new AllAccountsViewModel
            {
                Accounts = this.accountsService.GetAll <AccountViewModel>(),
            };

            return(this.View(viewModel));
        }
Beispiel #3
0
        public ActionResult All()
        {
            AllAccountsViewModel allUsers = this.service.GetAllUsers();

            return(View(allUsers));
        }