my code only works if I search correctly for the Name from the table. I must search for the FULL name and spell it corretly with uppercase etc. E.g. I Cannot search for 'The Martian' by searching 'the martian' or 'martian' etc.
using(MovieEntities db = new MovieEntities()){
var searchMovie = new List<Movie>(db.Moviess.ToList());
var searchFilter = new List<Movie>();
foreach (var search in searchMovie)
{
if (search.Name.Contains(txtSearch.Text))
{
searchFilter.Add(search);
//so far, only adds if I search it's full/correctly name
}
}/* print out */}
How can I search if it contains ANY parts of the txtSearch.Text and also ignoring under-/uppercase etc ?
PS: Im trying to learn about LINQ, I would appreciate if you also could give an alternative Linq solution.
Thanks