예제 #1
0
 public Meetup(MeetupTitle title, Location location)
 {
     Title         = title;
     Location      = location;
     State         = MeetupState.Created;
     NumberOfSeats = NumberOfSeats.None;
 }
예제 #2
0
 public Meetup(MeetupId id, MeetupTitle title, Address location, SeatsNumber numberOfSeats, DateTimeRange timeRange, MeetupState state)
 {
     Id            = id;
     Title         = title;
     Location      = location;
     NumberOfSeats = numberOfSeats;
     TimeRange     = timeRange;
     State         = state;
     EnsureInvariants(State);
 }
예제 #3
0
 public Meetup(MeetupId id, MeetupTitle title)
 {
     Id            = id;
     Title         = title;
     Location      = Address.None;
     NumberOfSeats = SeatsNumber.None;
     TimeRange     = DateTimeRange.None;
     State         = MeetupState.Created;
     EnsureInvariants();
 }
예제 #4
0
 public MeetupAggregate(
     MeetupId id,
     MeetupTitle title,
     ValidatedLocation location,
     NumberOfSeats seats,
     MeetupState state,
     Dictionary <MemberId, DateTime> going,
     Dictionary <MemberId, DateTime> notGoing)
 {
     Id            = id;
     Title         = title;
     Location      = location;
     NumberOfSeats = seats;
     State         = state;
     _going        = going;
     _notGoing     = notGoing;
 }
예제 #5
0
 public Meetup(
     MeetupId id,
     MeetupTitle title,
     Address location,
     SeatsNumber numberOfSeats,
     DateTimeRange timeRange,
     Dictionary <MemberId, DateTime> membersGoing,
     Dictionary <MemberId, DateTime> membersNotGoing,
     MeetupState state)
 {
     Id               = id;
     Title            = title;
     Location         = location;
     NumberOfSeats    = numberOfSeats;
     TimeRange        = timeRange;
     State            = state;
     _membersGoing    = membersGoing;
     _membersNotGoing = membersNotGoing;
     EnsureInvariants();
 }
예제 #6
0
        protected override void When(object @event)
        {
            State.EnsureCanRaiseEvent(@event.GetType());
            switch (@event)
            {
            case Events.MeetupCreated ev:
                Id    = MeetupId.From(ev.Id);
                Title = MeetupTitle.From(ev.Title);
                State = MeetupState.Created;
                break;

            case Events.MeetupPublished ev:
                State = MeetupState.Published;
                break;

            case Events.MeetupCanceled ev:
                State = MeetupState.Canceled;
                break;

            case Events.MeetupClosed ev:
                State = MeetupState.Closed;
                break;

            case Events.MeetupNumberOfSeatsUpdated ev:
                NumberOfSeats = SeatsNumber.From(ev.NumberOfSeats);
                break;

            case Events.MeetupTimeUpdated ev:
                TimeRange = DateTimeRange.From(ev.Start, ev.End);
                break;

            case Events.MeetupTitleUpdated ev:
                Title = MeetupTitle.From(ev.Title);
                break;

            case Events.MeetupLocationUpdated ev:
                Location = Address.From(ev.Location);
                break;
            }
        }
예제 #7
0
 public Meetup(MeetupId id, MeetupTitle title) =>
예제 #8
0
 public void UpdateTitle(MeetupTitle title)
 {
     Title = title;
     EnsureInvariants();
 }
예제 #9
0
 public MeetupAggregate(MeetupId id, MeetupTitle title, ValidatedLocation location) =>
예제 #10
0
 public void UpdateTitle(MeetupTitle title) =>
 Apply(new Events.MeetupTitleUpdated(Id, title));
예제 #11
0
 public void Create(MeetupId id, MeetupTitle title) =>
 Apply(new Events.MeetupCreated(id, title));