private static void Raise(RSVPed rsvped)
        {
            var dinners = new NerdDinners();

            PopularDinner.Handle(dinners, Event.Make(rsvped, Guid.NewGuid(), 0));
            dinners.SaveChanges();
        }
        private PopularDinner PopularDinnerFromDinner(Dinner dinner)
        {
            var result = new PopularDinner();

            foreach (var prop in typeof(Dinner).GetProperties())
            {
                var propOnPopularDinner = typeof(PopularDinner).GetProperties().FirstOrDefault(p => p.Name == prop.Name);
                if (propOnPopularDinner == null)
                {
                    continue;
                }
                propOnPopularDinner.SetValue(result, prop.GetValue(dinner, null), null);
            }

            return(result);
        }
Ejemplo n.º 3
0
        private static JsonDinner JsonDinnerFromPopularDinner(PopularDinner popularDinner)
        {
            return(new JsonDinner
            {
                DinnerId = popularDinner.DinnerId,
                EventDate = popularDinner.EventDate,
                Latitude = popularDinner.Latitude.GetValueOrDefault(),
                Longitude = popularDinner.Longitude.GetValueOrDefault(),
                Title = popularDinner.Title,
                Description = popularDinner.Description,
                RSVPCount = popularDinner.RsvpCount.GetValueOrDefault().ToString(),

                //TODO: Need to mock this out for testing...
                //Url = Url.RouteUrl("PrettyDetails", new { Id = dinner.DinnerID } )
                Url = popularDinner.DinnerId.ToString()
            });
        }