Object-Entity Mapping Attributes (Entity Framework)
The following Entity Data Model (EDM) attributes must be applied to the appropriate namespace, class, and data properties:
Attribute | Applies to: | Definition |
---|---|---|
Each complex type property that belongs to an entity type in the conceptual schema definition language (CSDL). |
Indicates that the property maps to a complex type property. |
|
Each class that maps to a complex type in the CSDL. |
Indicates that the type is mapped to a complex type. |
|
Each class that maps to an entity type in the CSDL. |
Indicates that the class is mapped to an entity. |
|
Each property that is a navigation property. |
Indicates that the property is a navigation property for the association that relates this type to another entity type or collection. You must specify the name of the association for the RelationshipName property. You must also specify the role name of the targeted entity at the other end of the association for the TargetRoleName property. |
|
The assembly level; once for each association between types defined in the CSDL. |
Indicates how two types are associated in an assembly. You must specify the following properties:
|
|
Each scalar property of an entity or complex type in the CSDL. |
Indicates that the property maps to a scalar property. If the property is the object's key, set the EntityKeyProperty property to true. |
|
Each assembly that contains classes that map to an EDM. |
Indicates that the assembly has data classes that are mapped to EDM types. |
For more information, see How to: Map Custom Objects to Entities (Entity Framework).