void ApplyEvent(RSVPed rsvpedEvent) { var rsvp = new RSVP(); rsvp.DinnerID = this.DinnerID; rsvp.AttendeeName = rsvpedEvent.FriendlyName; rsvp.AttendeeNameId = rsvpedEvent.Name; _rsvps.Add(rsvp); }
private static void Raise(RSVPed rsvped) { var dinners = new NerdDinners(); PopularDinner.Handle(dinners,Event.Make(rsvped,Guid.NewGuid(),0)); dinners.SaveChanges(); }
public ICollection<Event> RSVP(string name, string friendlyName) { return EventScope.Start(()=>{ if (IsUserRegistered(name)) { return; } var RSVPedEvent = new RSVPed { Name = name, FriendlyName = friendlyName, DinnerId = DinnerID }; RaiseAndApply(RSVPedEvent); }); }
public ICollection<Event> RSVP(string name, string friendlyName) { try { if (IsUserRegistered(name)) { return new List<Event>(); } var RSVPedEvent = new RSVPed { Name = name, FriendlyName = friendlyName }; RaiseAndApply(RSVPedEvent); return this._publishedEvents.ToList(); } finally { this._publishedEvents.Clear(); } }