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:  Microsoft.Data.OData (in Microsoft.Data.OData.dll)

Syntax

'Declaration
Public ReadOnly Property TargetPath As String 
    Get
'Usage
Dim instance As EntityPropertyMappingAttribute 
Dim value As String 

value = instance.TargetPath
public string TargetPath { get; }
public:
property String^ TargetPath {
    String^ get ();
}
member TargetPath : string
function get TargetPath () : String

Property Value

Type: System.String
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="https://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.

See Also

Reference

EntityPropertyMappingAttribute Class

System.Data.Services.Common Namespace