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(); }
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()); }
public async Task <IActionResult> SearchUser(SearchUserInputModel model) { var user = await this.usersService.GetUsersByUserNameAsync <SearchUserViewModel>(model.Username); return(this.View("SearchUserList", user)); }