Exemplo n.º 1
0
        public void RemoveGroup(グループ group)
        {
            AssertionConcern.AssertArgumentNotNull(group, "Group must not be null.");
            AssertionConcern.AssertArgumentEquals(this.TenantId, group.TenantId, "Wrong tenant for this group.");

            // not a nested remove, only direct member
            if (this.GroupMembers.Remove(group.ToGroupMember()) && (!this.IsInternalGroup))
            {
                DomainEventPublisher
                    .Instance
                    .Publish(new グループグループ削除時(
                            this.TenantId,
                            this.Name,
                            group.Name));
            }
        }
Exemplo n.º 2
0
        public void AddGroup(グループ group, グループメンバーサービス groupMemberService)
        {
            AssertionConcern.AssertArgumentNotNull(group, "Group must not be null.");
            AssertionConcern.AssertArgumentEquals(this.TenantId, group.TenantId, "Wrong tenant for this group.");
            AssertionConcern.AssertArgumentFalse(groupMemberService.IsMemberGroup(group, this.ToGroupMember()), "Group recurrsion.");

            if (this.GroupMembers.Add(group.ToGroupMember()) && (!this.IsInternalGroup))
            {
                DomainEventPublisher
                    .Instance
                    .Publish(new グループグループ追加時(
                            this.TenantId,
                            this.Name,
                            group.Name));
            }
        }