public void Patch(string id, [FromBody] MergePatchOrganizationStructureDto value) { try { OrganizationStructuresControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _organizationStructureApplicationService.When(value as IMergePatchOrganizationStructure); } catch (Exception ex) { var response = OrganizationStructuresControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }
public void Delete(string id, string commandId, string version, string requesterId = default(string)) { try { var value = new DeleteOrganizationStructureDto(); value.CommandId = commandId; value.RequesterId = requesterId; value.Version = (long)Convert.ChangeType(version, typeof(long)); OrganizationStructuresControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _organizationStructureApplicationService.When(value as IDeleteOrganizationStructure); } catch (Exception ex) { var response = OrganizationStructuresControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }
public void Put(string id, [FromBody] CreateOrMergePatchOrDeleteOrganizationStructureDto value) { try { // /////////////////////////////// if (value.Version != default(long)) { value.CommandType = CommandType.MergePatch; OrganizationStructuresControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _organizationStructureApplicationService.When(value as IMergePatchOrganizationStructure); return; } // /////////////////////////////// OrganizationStructuresControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _organizationStructureApplicationService.When(value as ICreateOrganizationStructure); } catch (Exception ex) { var response = OrganizationStructuresControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }