示例#1
0
        public async void FetchData()
        {
            var service = new UserQuery();
            var result  = await service.GetAllUsers();

            if (result.Data != null)
            {
                var items = result.Data.Users.OrderBy(m => m.LastName).ToList();
                Users = new ObservableCollection <User>(items);
            }
        }
示例#2
0
        public ActionResult ShowUsers()
        {
            UserQuery   userQuery      = new UserQuery();
            List <User> listOfAllUsers = userQuery.GetAllUsers();

            if (listOfAllUsers.Count > 0)
            {
                ViewData["AllUsers"] = listOfAllUsers;
                return(View());
            }
            else
            {
                return(RedirectToAction("Index"));
            }
        }