Example #1
0
 /*Event Handlers*/
 private void OnRegistered(MeetupRegistered @event)
 {
     Id          = new MeetupId(@event.MeetupId);
     OrganizerId = new OrganizerId(@event.OrganizerId);
     Subject     = new Subject(@event.Subject);
     When        = new When(@event.When);
     Description = new Description(@event.Description);
     Location    = new Location
     {
         Address = new Address(@event.Address)
     };
 }
Example #2
0
        public async Task Register(MeetupId meetupId, OrganizerId organizerId, Subject subject, When when, Description description, Address address, IMeetupPolicy policy)
        {
            if (Version >= 0)
            {
                throw new MeetupAlreadyRegisteredException();
            }

            await policy.CheckCanDefineMeetupAsync(organizerId, when);

            ApplyEvent(new MeetupRegistered
            {
                MeetupId    = meetupId,
                OrganizerId = organizerId,
                Subject     = subject,
                When        = when,
                Description = description,
                Address     = address,
                CreatedDate = DateTime.Now
            });
        }
Example #3
0
 private void OnAddressChanged(MeetupAddressChanged @event)
 {
     Id = new MeetupId(@event.MeetupId);
     Location.Address = new Address(@event.Address);
 }
Example #4
0
 private void OnDescriptionChanged(MeetupDescriptionChanged @event)
 {
     Id          = new MeetupId(@event.MeetupId);
     Description = new Description(@event.Description);
 }
Example #5
0
 private void OnWhenChanged(MeetupWhenChanged @event)
 {
     Id   = new MeetupId(@event.MeetupId);
     When = new When(@event.When);
 }
Example #6
0
 private void OnSubjectChanged(MeetupSubjectChanged @event)
 {
     Id      = new MeetupId(@event.MeetupId);
     Subject = new Subject(@event.Subject);
 }