public SupplierProductStateCreatedOrMergePatchedOrDeletedDto GetStateEvent(string id, long version) { try { var idObj = SupplierProductsControllerUtils.ParseIdString(id); var conv = new SupplierProductStateEventDtoConverter(); var se = _supplierProductApplicationService.GetEvent(idObj, version); return(se == null ? null : conv.ToSupplierProductStateEventDto(se)); } catch (Exception ex) { var response = SupplierProductsControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }
public ISupplierProductStateDto Get(string id, string fields = null) { try { var idObj = SupplierProductsControllerUtils.ParseIdString(id); var state = _supplierProductApplicationService.Get(idObj); if (state == null) { return(null); } var stateDto = new SupplierProductStateDtoWrapper(state); if (String.IsNullOrWhiteSpace(fields)) { stateDto.AllFieldsReturned = true; } else { stateDto.ReturnedFieldsString = fields; } return(stateDto); } catch (Exception ex) { var response = SupplierProductsControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }