EntityPropertyMappingAttribute.TargetPath 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得摘要中與屬性對應的自訂目標名稱。
public:
property System::String ^ TargetPath { System::String ^ get(); };
public string TargetPath { get; }
member this.TargetPath : string
Public ReadOnly Property TargetPath As String
屬性值
包含目標 XML 項目或屬性的字串值。
備註
TargetPath設定屬性時,TargetNamespaceUri也必須設定 和 TargetNamespacePrefix 屬性。
當 屬性的值TargetPathnull
TargetSyndicationItem不是 CustomProperty時,必須在 Visual Basic 中 (Nothing
值) 。
TargetPath 必須是路徑表達式,其中巢狀專案是以反斜杠分隔 () /
,而屬性是由) @
(指定。 下列範例中,字串 UnitsInStock/@ReorderLevel
將屬性值對應至名為 ReorderLevel
的屬性,位於根項目中名為 UnitsInStock
的子項目之上。
<Property Name="ReorderLevel" Type="Int16"
m:FC_TargetPath="UnitsInStock/@ReorderLevel"
m:FC_NsPrefix="Northwind"
m:FC_NsUri="http://schemas.examples.microsoft.com/dataservices"
m:FC_KeepInContent="false"
/>
屬性 TargetPath 不能包含空格符。
屬性 TargetPath 不會以真正的 XPath 運算式表示,但指定的專案和屬性名稱必須代表格式正確的 XML 元素和屬性。 無效的值會導致數據服務初始化時發生例外狀況。