Why is String.Contains not case sensitive in this query?

I am going through this ASP MVC tutorial . This tutorial page is about writing a simple search page. The controller contains this method:

public ActionResult SearchIndex(string searchString) 
{           
     var movies = from m in db.Movies 
                  select m; 

    if (!String.IsNullOrEmpty(searchString)) 
    { 
        movies = movies.Where(s => s.Title.Contains(searchString)); 
    } 

    return View(movies); 
}

According to MSDN, it String.Containsis case sensitive. But when I go to [website url]/Movies/SearchIndex?searchString=mel, it returns a movie with a title in the end Melancholia. If I test the controller method in the debugger, it searchStringwill be mel(in lowercase) as expected.

Why is String.Containsthis type case-insensitively consistent?

+5
source share
1 answer

Linq to entities SQL Server. Lambda SQL-, , , .

SQL Server , . : http://blog.sqlauthority.com/2007/04/30/case-sensitive-sql-query-search/

+14

All Articles