View Single Post
  #1 (permalink)  
Old October 13th, 2010, 10:41 AM
flyinhawaiian flyinhawaiian is offline
Friend of Wrox
Points: 539, Level: 8
Points: 539, Level: 8 Points: 539, Level: 8 Points: 539, Level: 8
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2010
Location: Seattle
Posts: 106
Thanks: 1
Thanked 17 Times in 17 Posts
Default 'Double DistanceBetween..' cannot be translated into a LINQ to Expression

Page 140
I got a runtime error when search is pressed. Doesn't appear that anyone else has this problem or maybe just unreported.

Error:
base {System.SystemException} = {"The specified method 'Double DistanceBetween(Double, Double, Double, Double)' on the type
'NerdDinner.Models.DinnerRepository' cannot be translated into a LINQ to Entities store expression."}

Traced the problem to Code Snippet 1-99.txt

DinnerRepository.cs
Change this:
[EdmFunction("NerdDinnerModel.Store", "DistanceBetween")]

To this:
Code:
[EdmFunction("NerdDinner.Models.Store", "DistanceBetween")]
Note on Page 24, Figure 1-46 shows Model Namespace: NerdDinner.Models.
Reply With Quote