LINQ to Entities does not recognize the method 'System.String Last[String](System.Collections.Generic.IEnumerable`1[System.String])' method, and this method cannot be translated into a store expression.

Santosh Umarani 81 Reputation points
2022-02-22T12:17:30.713+00:00

Hi,

I am executing the following query:
var testCases1 =
dbContext.CaseMasters.Where(x => x.VersionMasters.Any(s => s.IsDeleted && x.TestCaseID == s.TestCaseID
&& s.SupportedVersion.VersionID == s.SupportedVersionId
&& s.SupportedVersion.VersionBranches.Any(b => b.Branch. == branchName))
&& x.ProjectsMaster.TestProjectID == x.TestProjectID).AsEnumerable();

int count1 = testCases1.Count();

I am getting the error "LINQ to Entities does not recognize the method 'System.String LastString' method, and this method cannot be translated into a store expression."
May I know what am I doing wrong ? Please help me resolve the issue.
Kindly waiting for your response.

Thanks,
Santosh

Developer technologies .NET Other
Developer technologies C#
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.