EntityPropertyMappingAttribute Class
Attribute that specifies a custom mapping between properties of an entity type and elements of an entry in a feed returned by WCF Data Services.
Assembly: System.Data.Services.Client (in System.Data.Services.Client.dll)
The EntityPropertyMappingAttribute type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | EntityPropertyMappingAttribute(String, SyndicationItemProperty, SyndicationTextContentKind, Boolean) | Creates a new instance of the EntityPropertyMappingAttribute. |
![]() | EntityPropertyMappingAttribute(String, String, String, String, Boolean) | Creates an instance of the EntityPropertyMappingAttribute to map a property to a custom feed element. |
| Name | Description | |
|---|---|---|
![]() | KeepInContent | Gets a Boolean value that indicates whether a property value should be repeated both in the content section of the feed and in the mapped location. |
![]() | SourcePath | Gets the name of the property of the syndication item that will be mapped to the specified element of the feed. |
![]() | TargetNamespacePrefix | Gets a string value that, together with TargetNamespaceUri, specifies the namespace in which the TargetPathelement exists. |
![]() | TargetNamespaceUri | Gets a string value that specifies the namespace URI of the element specified by the TargetPath property. |
![]() | TargetPath | Gets the name of the custom target in the feed to which the property is mapped. |
![]() | TargetSyndicationItem | Gets a property on the SyndicationItem class. |
![]() | TargetTextContentKind | Gets the type of content of the property mapped by EntityPropertyMappingAttribute. |
![]() | TypeId | When implemented in a derived class, gets a unique identifier for this Attribute. (Inherited from Attribute.) |
| Name | Description | |
|---|---|---|
![]() | Equals | Infrastructure. Returns a value that indicates whether this instance is equal to a specified object. (Inherited from Attribute.) |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() | GetHashCode | Returns the hash code for this instance. (Inherited from Attribute.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | IsDefaultAttribute | When overridden in a derived class, indicates whether the value of this instance is the default value for the derived class. (Inherited from Attribute.) |
![]() | Match | When overridden in a derived class, returns a value that indicates whether this instance equals a specified object. (Inherited from Attribute.) |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
| Name | Description | |
|---|---|---|
![]() ![]() | _Attribute::GetIDsOfNames | Maps a set of names to a corresponding set of dispatch identifiers. (Inherited from Attribute.) |
![]() ![]() | _Attribute::GetTypeInfo | Retrieves the type information for an object, which can be used to get the type information for an interface. (Inherited from Attribute.) |
![]() ![]() | _Attribute::GetTypeInfoCount | Retrieves the number of type information interfaces that an object provides (either 0 or 1). (Inherited from Attribute.) |
![]() ![]() | _Attribute::Invoke | Provides access to properties and methods exposed by an object. (Inherited from Attribute.) |
The EntityPropertyMappingAttribute is used to define custom feed mapping in the data model of a reflection provider. This attribute is also applied to generated client data service classes when the metadata used to generate the classes indicates that custom feed mappings are defined in the data model. This information is necessary to make sure that the client can create and consume messages that support custom feeds. For more information, see Atom Feed Customization (WCF Data Services).
In the following example, both properties of the Order type are mapped to existing feed elements. The Product property of the Item type is mapped to a custom feed attribute in a separate namespace.
The previous example returns the following result for the URI http://myservice/OrderItems.svc/Orders(0)?$expand=Items.
<entry xml:base="http://localhost:12345/OrderItems.svc/" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom"> <id>http://localhost:12345/OrderItems.svc/Orders(0)</id> <title type="text">0</title> <updated>2009-07-25T21:12:30Z</updated> <author> <name>Peter Franken</name> </author> <link rel="edit" title="Order" href="Orders(0)" /> <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Items" type="application/atom+xml;type=feed" title="Items" href="Orders(0)/Items"> <m:inline> <feed> <title type="text">Items</title> <id>http://localhost:12345/OrderItems.svc/Orders(0)/Items</id> <updated>2009-07-25T21:12:30Z</updated> <link rel="self" title="Items" href="Orders(0)/Items" /> <entry> <id>http://localhost:12345/OrderItems.svc/Items('Chai')</id> <title type="text" /> <updated>2009-07-25T21:12:30Z</updated> <author> <name /> </author> <link rel="edit" title="Item" href="Items('Chai')" /> <category term="CustomDataService.Item" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /> <content type="application/xml"> <m:properties> <d:Product>Chai</d:Product> <d:Quantity m:type="Edm.Int32">10</d:Quantity> </m:properties> </content> <orders:productname xmlns:orders="http://schema.examples.microsoft.com/dataservices">Chai</orders:productname> </entry> <entry> <id>http://localhost:12345/OrderItems.svc/Items('Chang')</id> <title type="text" /> <updated>2009-07-25T21:12:30Z</updated> <author> <name /> </author> <link rel="edit" title="Item" href="Items('Chang')" /> <category term="CustomDataService.Item" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /> <content type="application/xml"> <m:properties> <d:Product>Chang</d:Product> <d:Quantity m:type="Edm.Int32">25</d:Quantity> </m:properties> </content> <orders:productname xmlns:orders="http://schema.examples.microsoft.com/dataservices">Chang</orders:productname> </entry> </feed> </m:inline> </link> <category term="CustomDataService.Order" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /> <content type="application/xml"> <m:properties> <d:Customer>Peter Franken</d:Customer> </m:properties> </content> </entry>
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.
