I am getting one exception while using a substring with lastindex of, exception is given below
LINQ to Entities does not recognize the method 'Int32 LastIndexOf(System.String)' method, and this method cannot be translated into a store expression
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
filename = MyFileName.xml
var record = (from fd in db.Details
where (fd.FullName.Substring(fd.FileName.LastIndexOf("\\") + 1)) == fileName
select fd).First();