Exemple #1
0
 public InventoryItemStateCreatedOrMergePatchedOrDeletedDto GetStateEvent(string id, long version)
 {
     try {
         var idObj = InventoryItemsControllerUtils.ParseIdString(id);
         var conv  = new InventoryItemStateEventDtoConverter();
         var se    = _inventoryItemApplicationService.GetEvent(idObj, version);
         return(se == null ? null : conv.ToInventoryItemStateEventDto(se));
     } catch (Exception ex) { var response = InventoryItemsControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }
Exemple #2
0
 public IInventoryItemStateDto Get(string id, string fields = null)
 {
     try {
         var idObj = InventoryItemsControllerUtils.ParseIdString(id);
         var state = _inventoryItemApplicationService.Get(idObj);
         if (state == null)
         {
             return(null);
         }
         var stateDto = new InventoryItemStateDtoWrapper(state);
         if (String.IsNullOrWhiteSpace(fields))
         {
             stateDto.AllFieldsReturned = true;
         }
         else
         {
             stateDto.ReturnedFieldsString = fields;
         }
         return(stateDto);
     } catch (Exception ex) { var response = InventoryItemsControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }