示例#1
0
        public static IEnumerable <AttributeSetStateDto> ToAttributeSetStateDtoCollection(IEnumerable <string> ids)
        {
            var states = new List <AttributeSetStateDto>();

            foreach (var id in ids)
            {
                var dto = new AttributeSetStateDto();
                dto.AttributeSetId = id;
                states.Add(dto);
            }
            return(states);
        }
示例#2
0
 public AttributeSetStateDto Get(string id, string fields = null)
 {
     try {
         var idObj = id;
         var state = (AttributeSetState)_attributeSetApplicationService.Get(idObj);
         if (state == null)
         {
             return(null);
         }
         var stateDto = new AttributeSetStateDto(state);
         if (String.IsNullOrWhiteSpace(fields))
         {
             stateDto.AllFieldsReturned = true;
         }
         else
         {
             stateDto.ReturnedFieldsString = fields;
         }
         return(stateDto);
     } catch (Exception ex) { var response = AttributeSetsControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }