Example #1
0
        public static IEnumerable <IPickwaveStateDto> ToPickwaveStateDtoCollection(IEnumerable <long?> ids)
        {
            var states = new List <IPickwaveStateDto>();

            foreach (var id in ids)
            {
                var dto = new PickwaveStateDtoWrapper();
                dto.PickwaveId = id;
                states.Add(dto);
            }
            return(states);
        }
Example #2
0
 public IPickwaveStateDto Get(long?id, string fields = null)
 {
     try {
         var idObj = id;
         var state = _pickwaveApplicationService.Get(idObj);
         if (state == null)
         {
             return(null);
         }
         var stateDto = new PickwaveStateDtoWrapper(state);
         if (String.IsNullOrWhiteSpace(fields))
         {
             stateDto.AllFieldsReturned = true;
         }
         else
         {
             stateDto.ReturnedFieldsString = fields;
         }
         return(stateDto);
     } catch (Exception ex) { var response = PickwavesControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }