EntityPropertyMappingAttribute::TargetPath Property

 

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

Namespace:   System.Data.Services.Common
Assembly:  System.Data.Services.Client (in System.Data.Services.Client.dll)

public:
property String^ TargetPath {
	String^ get();
}

Property Value

Type: System::String^

String value with target XML element or attribute.

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 whitespace.

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.

.NET Framework
Available since 3.5
Silverlight
Available since 4.0
Return to top
Show: