This documentation is archived and is not being maintained.

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 string TargetPath { 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"
          />



<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

Supported in: 4

.NET Framework Client Profile

Supported in: 4

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: