Пример #1
0
        public ActionResult SearchUsers(SearchUserInputModel model)
        {
            if (this.ModelState.IsValid)
            {
                var foundUsersIndata = this.users.All().Where(a => a.UserName.ToUpper().Contains(model.search.ToUpper())).OrderBy(u => u.UserName).ToList();
                var foundUsersToView = AutoMapperConfig.Configuration.CreateMapper().Map<List<AppUserViewModel>>(foundUsersIndata);
                return this.View(foundUsersToView);
            }

            return this.View();
        }
Пример #2
0
        public ActionResult SearchUsers(SearchUserInputModel model)
        {
            if (this.ModelState.IsValid)
            {
                var foundUsersIndata = this.users.All().Where(a => a.UserName.ToUpper().Contains(model.search.ToUpper())).OrderBy(u => u.UserName).ToList();
                var foundUsersToView = AutoMapperConfig.Configuration.CreateMapper().Map <List <AppUserViewModel> >(foundUsersIndata);
                return(this.View(foundUsersToView));
            }

            return(this.View());
        }
Пример #3
0
        public async Task <IActionResult> SearchUser(SearchUserInputModel model)
        {
            var user = await this.usersService.GetUsersByUserNameAsync <SearchUserViewModel>(model.Username);

            return(this.View("SearchUserList", user));
        }