Click here to Skip to main content
15,912,756 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi,
I am working with code first approach in EDM and facing an error for which I can't the solution.Pls help me

LINQ to Entities does not recognize the method 'Boolean CheckMeetingSettings(Int64, Int64)' method, and this method cannot be translated into a store expression.

My code is following(this is the query which I have written

from per in obj.tempPersonConferenceDbSet
                     where per.Conference.Id == 2
                     select new PersonDetials
                     {
                         Id = per.Person.Id,
                         JobTitle = per.Person.JobTitle,
                     CanSendMeetingRequest = CheckMeetingSettings(6327,per.Person.Id)

}

For the above underline code I am getting the error.

public bool CheckMeetingSettings(int,int)
{
  ///code I have written.
}
Posted
Updated 4-Apr-12 21:21pm
v2

1 solution

You can split your query in two to make sure the list is in-memory before calling the method. You can make a query in-memory by converting the results to a List,
have a look at:
http://stackoverflow.com/questions/3316615/linq-to-entities-does-not-recognize-the-method-int32[^]
in this page see the accepted solution,that will help you
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900