Example #1
0
        public static IEnumerable <IShipmentMethodTypeStateDto> ToShipmentMethodTypeStateDtoCollection(IEnumerable <string> ids)
        {
            var states = new List <IShipmentMethodTypeStateDto>();

            foreach (var id in ids)
            {
                var dto = new ShipmentMethodTypeStateDtoWrapper();
                dto.ShipmentMethodTypeId = id;
                states.Add(dto);
            }
            return(states);
        }
Example #2
0
 public IShipmentMethodTypeStateDto Get(string id, string fields = null)
 {
     try {
         var idObj = id;
         var state = _shipmentMethodTypeApplicationService.Get(idObj);
         if (state == null)
         {
             return(null);
         }
         var stateDto = new ShipmentMethodTypeStateDtoWrapper(state);
         if (String.IsNullOrWhiteSpace(fields))
         {
             stateDto.AllFieldsReturned = true;
         }
         else
         {
             stateDto.ReturnedFieldsString = fields;
         }
         return(stateDto);
     } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }