public IActionResult OnGet(string id) { UserDetails = m_userManager.FindByIdAsync(id).Result; var lijst = m_userManager.GetRolesAsync(UserDetails).Result; CurrentRole = lijst.FirstOrDefault(); Companies = m_exactOnlineService.GetCompanies(); UserInCompany = m_userInCompanyService.GetUsersInCompany().Find(x => x.UserId == UserDetails.Id); return(Page()); }
public void OnGet(string searchString) { Companies = m_exactOnlineService.GetCompanies(); ViewData["CurrentFilter"] = searchString; if (!String.IsNullOrEmpty(searchString)) { Companies = Companies.Where(x => x.Name.ToLower().Contains(searchString.ToLower())).ToList(); if (Companies.Count == 0) { ModelState.AddModelError(string.Empty, "No matching results"); } } }