public IOrganizationStructureStateEvent GetStateEvent(string id, long version) { try { var idObj = OrganizationStructuresControllerUtils.ParseIdString(id); return(_organizationStructureApplicationService.GetStateEvent(idObj, version)); } catch (Exception ex) { var response = OrganizationStructuresControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }
public OrganizationStructureStateCreatedOrMergePatchedOrDeletedDto GetStateEvent(string id, long version) { try { var idObj = OrganizationStructuresControllerUtils.ParseIdString(id); var conv = new OrganizationStructureStateEventDtoConverter(); var se = _organizationStructureApplicationService.GetEvent(idObj, version); return(se == null ? null : conv.ToOrganizationStructureStateEventDto(se)); } catch (Exception ex) { var response = OrganizationStructuresControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }
public IOrganizationStructureStateDto Get(string id, string fields = null) { try { var idObj = OrganizationStructuresControllerUtils.ParseIdString(id); var state = _organizationStructureApplicationService.Get(idObj); if (state == null) { return(null); } var stateDto = new OrganizationStructureStateDtoWrapper(state); if (String.IsNullOrWhiteSpace(fields)) { stateDto.AllFieldsReturned = true; } else { stateDto.ReturnedFieldsString = fields; } return(stateDto); } catch (Exception ex) { var response = OrganizationStructuresControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }