public static IEnumerable <IOrderShipmentStateDto> ToOrderShipmentStateDtoCollection(IEnumerable <OrderShipmentId> ids) { var states = new List <IOrderShipmentStateDto>(); foreach (var id in ids) { var dto = new OrderShipmentStateDtoWrapper(); dto.OrderShipmentId = id; states.Add(dto); } return(states); }
public IOrderShipmentStateDto Get(string id, string fields = null) { try { var idObj = OrderShipmentsControllerUtils.ParseIdString(id); var state = _orderShipmentApplicationService.Get(idObj); if (state == null) { return(null); } var stateDto = new OrderShipmentStateDtoWrapper(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); } }