public Meetup(MeetupTitle title, Location location) { Title = title; Location = location; State = MeetupState.Created; NumberOfSeats = NumberOfSeats.None; }
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); }
public Meetup(MeetupId id, MeetupTitle title) { Id = id; Title = title; Location = Address.None; NumberOfSeats = SeatsNumber.None; TimeRange = DateTimeRange.None; State = MeetupState.Created; EnsureInvariants(); }
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; }
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(); }
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; } }
public Meetup(MeetupId id, MeetupTitle title) =>
public void UpdateTitle(MeetupTitle title) { Title = title; EnsureInvariants(); }
public MeetupAggregate(MeetupId id, MeetupTitle title, ValidatedLocation location) =>
public void UpdateTitle(MeetupTitle title) => Apply(new Events.MeetupTitleUpdated(Id, title));
public void Create(MeetupId id, MeetupTitle title) => Apply(new Events.MeetupCreated(id, title));