title: .net How to make a search method non case sensitive?
body: <p>In my MVC web application I am creating a search function where i need to compare a search string with objects in my product repository - But how do I make sure that the search is not case sensitive?
  I can use ToLower() on my search string - but the repository?</p>
  
  <p>Controller:</p>
  
  <pre><code> public ActionResult Search(string q, int page = 1)
   {
          string search = q.ToLower();
          int productCounter = repository.Products.Where(p =&gt; p.Name.Contains(search) || p.Description.Contains(search)).Count();
  
              ProductsListViewModel model = new ProductsListViewModel
              {
                  Products = repository.Products
                  .Where(p =&gt; p.Name.Contains(search) || p.Description.Contains(search))
                  .OrderBy(p =&gt; p.ProductID)
                  .Skip((page - 1) * PageSize)
                  .Take(PageSize),
                  PagingInfo = new PagingInfo
                  {
                      CurrentPage = page,
                      ItemsPerPage = PageSize,
                      TotalItems = productCounter == 0 ? 0 : productCounter
                  }
              };
          return View("List", model);
      }
  </code></pre>