Ejemplo n.º 1
0
        public override UserGroupMembership Build()
        {
            if (_createdBy == null)
            {
                _createdBy = Create.A.User();
            }
            if (_userGroup == null)
            {
                _userGroup = Create.A.UserGroup();
            }
            if (_user == null)
            {
                _user = Create.A.User();
            }

            UserGroupMembership membership = new UserGroupMembership(_userGroup,
                                                                     _user,
                                                                     UserGroupMembershipType.Member,
                                                                     new EntityCreatedDto(_createdBy, _createdAt));

            _userGroupDao.Save(membership);
            _userGroupDao.Flush();

            return(membership);
        }
Ejemplo n.º 2
0
        public override UserGroup Build()
        {
            if (_createdBy == null)
            {
                _createdBy = Create.A.User();
            }

            UserGroup userGroup = new UserGroup(new UserGroupDto(_additionalInformation, _name, _accepteedBalance), new EntityCreatedDto(_createdBy, _createdAt));

            _userGroupDao.Save(userGroup);
            _userGroupDao.Flush();
            return(userGroup);
        }