Ejemplo n.º 1
0
        public ApiUserSearchResultsViewModel SearchApiUsers(ApiUserSearchViewModel searchViewModel)
        {
            var viewModel = new ApiUserSearchResultsViewModel
            {
                SearchViewModel = searchViewModel
            };

            if (!searchViewModel.PerformSearch)
            {
                return(viewModel);
            }

            var searchParameters = new ApiUserSearchParameters
            {
                ExternalSystemId = searchViewModel.ExternalSystemId,
                Id   = searchViewModel.Id,
                Name = searchViewModel.Name
            };

            var apiUsers = _apiUserRepository.SearchApiUsers(searchParameters);

            viewModel.ApiUsers = apiUsers.Select(a => ApiUserMappers.Map <ApiUser, ApiUserViewModel>(a)).ToList();

            return(viewModel);
        }
 public ActionResult SearchApiUsers(ApiUserSearchResultsViewModel viewModel)
 {
     viewModel.SearchViewModel.PerformSearch = true;
     return(RedirectToRoute(ManagementRouteNames.AdminApiUsers, viewModel.SearchViewModel));
 }