I have a search method which takes in the searched string that the user inputs, and return a list of strings with the name that starts with the searched string. My method contains both boolean isSearch VARIABLE AND the search string itself No, it is not a duplicate since another question asks about the model while mine asked about individual values respectively. isSearch is a boolean variable not found in any model.
public IActionResult Search(string search)
{
bool isSearch = true;
var ssList = Database.SessionSynopses.Where(x =>
x.SessionSynopsisName.StartsWith(search)).ToList();
return View(isSearch, ssList);
}
However, it throws me an error bool cannot be converted to string
I have tried all ways to return an object to the views, including viewbag, but none of them has worked so far.