Export (0) Print
Expand All

EntityReference Class

Base class that implements non-generic functionality for an EntityReference<TEntity>.

Namespace:  System.Data.Objects.DataClasses
Assembly:  System.Data.Entity (in System.Data.Entity.dll)

[SerializableAttribute]
[DataContractAttribute]
public abstract class EntityReference : RelatedEnd

The EntityReference type exposes the following members.

  NameDescription
Public propertyEntityKeyReturns the key for the related object.
Public propertyIsLoadedGets a value that indicates whether all related objects have been loaded. (Inherited from RelatedEnd.)
Public propertyRelationshipNameGets the name of the relationship in which this related end participates. (Inherited from RelatedEnd.)
Public propertyRelationshipSetGets a reference to the metadata for the related end. (Inherited from RelatedEnd.)
Public propertySourceRoleNameGets the role name at the source end of the relationship. (Inherited from RelatedEnd.)
Public propertyTargetRoleNameGets the role name at the target end of the relationship. (Inherited from RelatedEnd.)
Top

  NameDescription
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetEnumeratorReturns an IEnumerator that iterates through the collection of related objects. (Inherited from RelatedEnd.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodLoad()When overridden in a derived class, loads the related object or objects into the related end with the default merge option. (Inherited from RelatedEnd.)
Public methodLoad(MergeOption)When overridden in a derived class, loads an object or objects from the related end with the specified merge option. (Inherited from RelatedEnd.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodOnDeserializedInfrastructure. Used internally to deserialize entity objects along with the RelationshipManager instances. (Inherited from RelatedEnd.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

  NameDescription
Public eventAssociationChangedOccurs when a change is made to a related end. (Inherited from RelatedEnd.)
Top

  NameDescription
Explicit interface implemetationPrivate methodIRelatedEnd.Add(IEntityWithRelationships)Adds an object to the related end. (Inherited from RelatedEnd.)
Explicit interface implemetationPrivate methodIRelatedEnd.Add(Object)Adds an object to the related end. (Inherited from RelatedEnd.)
Explicit interface implemetationPrivate methodIRelatedEnd.Attach(IEntityWithRelationships)Attaches an object at the related end. (Inherited from RelatedEnd.)
Explicit interface implemetationPrivate methodIRelatedEnd.Attach(Object)Attaches an object to the related end. (Inherited from RelatedEnd.)
Explicit interface implemetationPrivate methodIRelatedEnd.CreateSourceQueryReturns an IEnumerable that represents the objects that belong to the related end. (Inherited from RelatedEnd.)
Explicit interface implemetationPrivate methodIRelatedEnd.Remove(IEntityWithRelationships)Removes an object from the collection at the related end. (Inherited from RelatedEnd.)
Explicit interface implemetationPrivate methodIRelatedEnd.Remove(Object)Removes an object from the related end if the object is part of the related end. (Inherited from RelatedEnd.)
Top

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 Navigation Properties (EDM).

.NET Framework

Supported in: 4.5, 4, 3.5 SP1

.NET Framework Client Profile

Supported in: 4

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft