private MeetingGroup(MeetingGroupProposalId meetingGroupProposalId, string name, string description, MeetingGroupLocation location, MemberId creatorId) { this.Id = new MeetingGroupId(meetingGroupProposalId.Value); this._name = name; this._description = description; this._creatorId = creatorId; this._location = location; this._createDate = SystemClock.Now; this.AddDomainEvent(new MeetingGroupCreatedDomainEvent(this.Id, creatorId)); this._members = new List <MeetingGroupMember>(); this._members.Add(MeetingGroupMember.CreateNew(this.Id, this._creatorId, MeetingGroupMemberRole.Organizer)); }
public void JoinToGroupMember(MemberId memberId) { this.CheckRule(new MeetingGroupMemberCannotBeAddedTwiceRule(_members, memberId)); this._members.Add(MeetingGroupMember.CreateNew(this.Id, memberId, MeetingGroupMemberRole.Member)); }