public async Task <ActionResult> Search(SpacesViewModel model) { var searchString = model.SearchString; var searchType = model.SearchType; model = new SpacesViewModel(_cache); int searchTypeId = searchType.Equals("All") ? -1 : model.SpaceTypeList.Single(t => t.Name.Equals(searchType)).Id; model.SpaceList = await DigitalTwinsHelper.SearchSpacesAsync(_cache, Loggers.SilentLogger, searchString, searchTypeId); return(View("List", model)); }