public OrderShipmentStateCreatedOrMergePatchedOrDeletedDto GetStateEvent(string id, long version) { try { var idObj = OrderShipmentsControllerUtils.ParseIdString(id); var conv = new OrderShipmentStateEventDtoConverter(); var se = _orderShipmentApplicationService.GetEvent(idObj, version); return(se == null ? null : conv.ToOrderShipmentStateEventDto(se)); } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }
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); } }