ערוך

שתף באמצעות


EntityPropertyMappingAttribute.TargetPath Property

Definition

Gets the name of the custom target in the feed to which the property is mapped.

public:
 property System::String ^ TargetPath { System::String ^ get(); };
public string TargetPath { get; }
member this.TargetPath : string
Public ReadOnly Property TargetPath As String

Property Value

String value with target XML element or attribute.

Remarks

When the TargetPath property is set, the TargetNamespaceUri and TargetNamespacePrefix properties must also be set.

The value of TargetPath must be null (Nothing in Visual Basic) when the value of the TargetSyndicationItem property is anything other than CustomProperty.

TargetPath must be a path expression in which nested elements are separated by a backslash (/) and attributes are specified by an ampersand (@). In the following example, the string UnitsInStock/@ReorderLevel maps a property value to an attribute named ReorderLevel on a child element named UnitsInStock of the root entry element.

<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"
          />

The TargetPath property cannot contain white space.

The TargetPath property is not expressed as a true XPath expression, but the specified element and attribute names must represent well-formed XML elements and attributes. An invalid value will cause an exception to occur when the data service is initialized.

Applies to