User2103319870 posted
Here I used "StartsWith" function but this is not much efficient. It only gets the results which starts with the typed letters. Is there any function I can use here that searches and gives me
the results of matching words for a search?
You can use Contains in linq like below
return View(db.AllTitles.Where(x => x.BookName.Contains(search) || search == null).ToList());