title: search decimal values in Linq query
body: <p>I have this search terms</p>
  
  <pre><code>[HttpPost]
  public ActionResult Index(string searchString)
  {
      if (!String.IsNullOrEmpty(searchString))
      {
          students = students.Where(s =&gt; s.FIRST_NAME.Contains(searchString) 
              || s.LAST_NAME.Contains(searchString)
              || s.PERSONAL_NUMBER.Contains(searchString)
              || s.ACD_UNI_DEGREES.DEGREE.Contains(searchString)
              || s.ACD_UNI_FACULTIES.FACULTY.Contains(searchString)
              || s.ACD_UNI_SPECIALIZATIONS.SPECIALIZATION.Contains(searchString)
              || SqlFunctions.StringConvert(s.SEMESTER).Contains(searchString) 
              || s.COR_PAYER_STATUS.NAME.Contains(searchString)
              || SqlFunctions.StringConvert(s.CREDIT_COUNT).Contains(searchString));
      }
  
      return View(students.ToList());
  }
  </code></pre>
  
  <p>but on debugging it throws an exception:</p>
  
  <blockquote>
    <p>System.NotSupportedException: The specified method 'System.String
    StringConvert(System.Nullable`1[System.Decimal])' on the type
    'System.Data.Objects.SqlClient.SqlFunctions' cannot be translated into
    a LINQ to Entities store expression.</p>
  </blockquote>
  
  <p>The problem is here:</p>
  
  <pre><code>SqlFunctions.StringConvert(s.SEMESTER).Contains(searchString)
  </code></pre>
  
  <p><em>SEMESTER</em> is decimal and <em>searchString</em> is string.
  How can I improve that? </p>