title: how to use substring in linq query?
body: <p>I am getting one exception while using a substring with lastindex of, 
    exception is given below</p>
  
  <blockquote>
    <p>LINQ to Entities does not recognize the method 'Int32 LastIndexOf(System.String)' method, and this method cannot be translated into a store expression   </p>
  </blockquote>
  
  <p>my db stored file name format is like this C:\Data\MyFileName.xml
  and I am passing the name of the file to find out specific record </p>
  
  <pre><code>filename = MyFileName.xml
  
  var record = (from fd in db.Details
  where (fd.FullName.Substring(fd.FileName.LastIndexOf("\\") + 1)) == fileName
                            select fd).First();
  </code></pre>