1

SdkMessageProcessingStepImageId の値に基づいて SdkMessageProcessingStepId 属性を選択しようとしています。以下の xml を参照してください。

<SdkMessageProcessingStep Name="Plugins.OnPreCreateUpdateCar: Update of new_car" SdkMessageProcessingStepId="{00c19595-76fd-e111-9528-005056af005a}">
  <PluginTypeName>Plugins.OnPreCreateUpdateCar, Plugins, Version=1.0.0.0, Culture=neutral, PublicKeyToken=9f59c17e3653dba0</PluginTypeName>
  <PrimaryEntity>new_car</PrimaryEntity>
  <AsyncAutoDelete>0</AsyncAutoDelete>
  <InvocationSource>1</InvocationSource>
  <Mode>0</Mode>
  <Rank>1</Rank>
  <SdkMessageId>{20bebb1b-ea3e-db11-86a7-000a3a5473e8}</SdkMessageId>
  <EventHandlerTypeCode>4602</EventHandlerTypeCode>
  <Stage>20</Stage>
  <IsCustomizable>1</IsCustomizable>
  <IsHidden>0</IsHidden>
  <SupportedDeployment>0</SupportedDeployment>
  <SdkMessageProcessingStepImages>
    <SdkMessageProcessingStepImage Name="PreImageCar">
      <SdkMessageProcessingStepImageId>{e3c5bcb1-76fd-e111-9528-005056af005a}</SdkMessageProcessingStepImageId>
      <EntityAlias>PreImageCar</EntityAlias>
      <ImageType>0</ImageType>
      <MessagePropertyName>Target</MessagePropertyName>
      <IsCustomizable>1</IsCustomizable>
    </SdkMessageProcessingStepImage>
  </SdkMessageProcessingStepImages>
</SdkMessageProcessingStep>

2 つのクエリ、結合など、さまざまなことを試しましたが、何も機能していないようです。結局、私はまったく別のソリューションを選択しましたが、1 つのクエリでこれを行う方法を知っておくと便利です。

ティア

4

1 に答える 1

1

あなたが何を達成しようとしているのかわかりません。しかし、これが役立つかもしれません:

 XElement xmlTree = XElement.Load(source);

 string[] result = xmlTree.Descendants("SdkMessageProcessingStepImageId")
                .Where(element => element.Value == "{e3c5bcb1-76fd-e111-9528-005056af005a}")
                .Select(element => element.Parent.Parent.Parent)
                .Attributes()
                .Where(attribute => attribute.Name == "SdkMessageProcessingStepId")
                .Select(attribute => attribute.Value)
                .ToArray();

結果:

{00c19595-76fd-e111-9528-005056af005a}
于 2012-09-13T19:27:55.597 に答える