Ejemplo n.º 1
0
        public ActionResult SearchByLocation(float longitude, float latitude)
        {
            var dinners     = dinnerRepository.FindByLocation(latitude, longitude);
            var jsonDinners = from dinner in dinners
                              select new JsonDinner
            {
                DinnerID    = dinner.DinnerID,
                Latitude    = dinner.Latitude,
                Longitude   = dinner.Longitude,
                Title       = dinner.Title,
                Description = dinner.Description,
                RSVPCount   = dinner.RSVP.Count
            };

            return(Json(jsonDinners.ToList()));
        }