EntityReference Class
Base class that implements non-generic functionality for an EntityReference<TEntity>.
Assembly: System.Data.Entity (in System.Data.Entity.dll)
System.Data.Objects.DataClasses::RelatedEnd
System.Data.Objects.DataClasses::EntityReference
System.Data.Objects.DataClasses::EntityReference<TEntity>
| Name | Description | |
|---|---|---|
![]() | EntityKey | Returns the key for the related object. |
![]() | IsLoaded | Gets a value that indicates whether all related objects have been loaded.(Inherited from RelatedEnd.) |
![]() | RelationshipName | Gets the name of the relationship in which this related end participates.(Inherited from RelatedEnd.) |
![]() | RelationshipSet | Gets a reference to the metadata for the related end.(Inherited from RelatedEnd.) |
![]() | SourceRoleName | Gets the role name at the source end of the relationship.(Inherited from RelatedEnd.) |
![]() | TargetRoleName | Gets the role name at the target end of the relationship.(Inherited from RelatedEnd.) |
| Name | Description | |
|---|---|---|
![]() | Equals(Object^) | Determines whether the specified object is equal to the current object.(Inherited from Object.) |
![]() | Finalize() | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.) |
![]() | GetEnumerator() | Returns an IEnumerator that iterates through the collection of related objects.(Inherited from RelatedEnd.) |
![]() | GetHashCode() | Serves as the default hash function. (Inherited from Object.) |
![]() | GetType() | |
![]() | Load() | When overridden in a derived class, loads the related object or objects into the related end with the default merge option.(Inherited from RelatedEnd.) |
![]() | Load(MergeOption) | When overridden in a derived class, loads an object or objects from the related end with the specified merge option.(Inherited from RelatedEnd.) |
![]() | MemberwiseClone() | |
![]() | OnDeserialized(StreamingContext) | This API supports the product infrastructure and is not intended to be used directly from your code. Used internally to deserialize entity objects along with the RelationshipManager instances.(Inherited from RelatedEnd.) |
![]() | ToString() | Returns a string that represents the current object.(Inherited from Object.) |
| Name | Description | |
|---|---|---|
![]() | AssociationChanged | Occurs when a change is made to a related end.(Inherited from RelatedEnd.) |
| Name | Description | |
|---|---|---|
![]() ![]() | IRelatedEnd::Add(IEntityWithRelationships^) | Adds an object to the related end.(Inherited from RelatedEnd.) |
![]() ![]() | IRelatedEnd::Add(Object^) | Adds an object to the related end.(Inherited from RelatedEnd.) |
![]() ![]() | IRelatedEnd::Attach(IEntityWithRelationships^) | Attaches an object at the related end.(Inherited from RelatedEnd.) |
![]() ![]() | IRelatedEnd::Attach(Object^) | Attaches an object to the related end.(Inherited from RelatedEnd.) |
![]() ![]() | IRelatedEnd::CreateSourceQuery() | Returns an IEnumerable that represents the objects that belong to the related end.(Inherited from RelatedEnd.) |
![]() ![]() | IRelatedEnd::Remove(IEntityWithRelationships^) | Removes an object from the collection at the related end.(Inherited from RelatedEnd.) |
![]() ![]() | IRelatedEnd::Remove(Object^) | Removes an object from the related end if the object is part of the related end.(Inherited from RelatedEnd.) |
The EntityReference class exposes the EntityKey of the related object and is a base class for the EntityReference<TEntity> class. An EntityReference<TEntity> object is returned by a navigation property when the related end has a multiplicity of zero or one. For more information, see NavigationProperty Element (CSDL).
Available since 3.5
Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.





