public async Task <IActionResult> SearchPeople(SearchPeopleModel vm) { var SearchTerm = vm.SearchTerm; // Uses the search term to find all the people related and returns a list to the original view if (SearchTerm != null) { vm.People = await _sql.FindPeopleWithSearchTermAsync(SearchTerm); return(View("SearchPeople", vm)); } // Otherwise just return the view with the supplied view model return(View("SearchPeople", vm)); }