title: Linq wild card search mvc c#
body: <p>i am trying to implement wild card search using linq in mvc application. but its not working.  please see my code, what i am missing here, everytime i click the search button it returns the same number of rows. means search is not working. please help</p>
  <pre><code>IEnumerable&lt;ProductList&gt; listProducts = null;
  listProducts = IProductRep.GetAllProducts();
  
  if (listProducts != null)
  {               
      if ((!String.IsNullOrEmpty(strName)) || (!String.IsNullOrEmpty(strCategory))|| (!String.IsNullOrEmpty(strBrand)))
      {
          listProducts = listProducts.Where(s =&gt; s.pro_name.StartsWith(strName, StringComparison.OrdinalIgnoreCase)
                          || s.CategoryName.StartsWith(strCategory,StringComparison.OrdinalIgnoreCase)
                          || s.BrandName.StartsWith(strBrand, StringComparison.OrdinalIgnoreCase)  );
      }
      ViewBag.totalRecords = listProducts.Count();
  }
  </code></pre>