Wrox Programmer Forums
BOOK: Professional ASP.NET MVC 2
This is the forum to discuss the Wrox book Professional ASP.NET MVC 2 by Jon Galloway, Scott Hanselman, Phil Haack, Scott Guthrie, Rob Conery; ISBN: Professional ASP.NET MVC 2
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional ASP.NET MVC 2 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old August 7th, 2010, 06:04 PM
Registered User
Join Date: Aug 2010
Posts: 3
Thanks: 1
Thanked 1 Time in 1 Post
Default NearestDinners Routine

I have worked my way to the FindByLocation routine (page 141) and it will not work. I have verified that everything is correct prior to that but I get an IDE error telling me that NearestDinners does not exist in the current context. I have tried searching the web, placing containers in front of the call, and many other things. What is the fix for this?
Old August 10th, 2010, 06:09 PM
Registered User
Join Date: Aug 2010
Posts: 1
Thanks: 0
Thanked 4 Times in 1 Post
Default NearestDinner Function

Totally missed from the book and code snippets - but here it is from the sample site:

// Helper Methods

[EdmFunction("NerdDinnerModel.Store", "DistanceBetween")]
public static double DistanceBetween(double lat1, double long1, double lat2, double long2) {
	throw new NotImplementedException("Only call through LINQ expression");

public IQueryable<Dinner> NearestDinners(double latitude, double longitude) {
	return from d in entities.Dinners
			where DistanceBetween(latitude, longitude, d.Latitude, d.Longitude) < 100
			select d;

Last edited by Aldo; August 10th, 2010 at 06:14 PM.. Reason: Error in object reference
The Following 4 Users Say Thank You to Aldo For This Useful Post:
firedrawndagger (November 7th, 2010), Olin (January 21st, 2011), slink9 (August 10th, 2010)

Similar Threads
Thread Thread Starter Forum Replies Last Post
Command Objects ( S.Q.L. in sub-routine ) ? liamfitz BOOK: Visual Basic 2008 Programmer's Reference ISBN: 978-0-470-18262-8 0 June 29th, 2009 03:46 PM
Routine Maintenance englere BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 10 May 2nd, 2009 04:25 AM
sub Routine problem NitinJoshi General .NET 1 January 5th, 2005 04:10 AM
File copy routine error! Janet C++ Programming 3 March 13th, 2004 02:41 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.