예제 #1
0
 public UomConversionStateCreatedOrMergePatchedOrDeletedDto GetStateEvent(string id, long version)
 {
     try {
         var idObj = UomConversionsControllerUtils.ParseIdString(id);
         var conv  = new UomConversionStateEventDtoConverter();
         var se    = _uomConversionApplicationService.GetEvent(idObj, version);
         return(se == null ? null : conv.ToUomConversionStateEventDto(se));
     } catch (Exception ex) { var response = UomConversionsControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }
예제 #2
0
 public IUomConversionStateDto Get(string id, string fields = null)
 {
     try {
         var idObj = UomConversionsControllerUtils.ParseIdString(id);
         var state = _uomConversionApplicationService.Get(idObj);
         if (state == null)
         {
             return(null);
         }
         var stateDto = new UomConversionStateDtoWrapper(state);
         if (String.IsNullOrWhiteSpace(fields))
         {
             stateDto.AllFieldsReturned = true;
         }
         else
         {
             stateDto.ReturnedFieldsString = fields;
         }
         return(stateDto);
     } catch (Exception ex) { var response = UomConversionsControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }