コード例 #1
0
        public List <GroupDTO> GetGroupsByTypeForParticipant(string token, int participantId, int groupTypeId)
        {
            var groupsByType = _mpGroupRepository.GetGroupsByTypeForParticipant(token, participantId, groupTypeId);

            if (groupsByType == null)
            {
                return(null);
            }

            var groupDetail = groupsByType.Select(Mapper.Map <MpGroup, GroupDTO>).ToList();

            var configuration = MpObjectAttributeConfigurationFactory.Group();
            var mpAttributes  = _attributeRepository.GetAttributes(null);

            foreach (var group in groupDetail)
            {
                var attributesTypes = _objectAttributeService.GetObjectAttributes(token, group.GroupId, configuration, mpAttributes);
                group.AttributeTypes   = attributesTypes.MultiSelect;
                group.SingleAttributes = attributesTypes.SingleSelect;
            }

            return(groupDetail);
        }