IRelatedEnd Interface

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Defines the end of a relationship.

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

public interface class IRelatedEnd

NameDescription
System_CAPS_pubpropertyIsLoaded

Gets a value that indicates whether all related objects have been loaded.

System_CAPS_pubpropertyRelationshipName

Gets the name of the relationship in which this related end participates.

System_CAPS_pubpropertyRelationshipSet

Returns a reference to the metadata for the related end.

System_CAPS_pubpropertySourceRoleName

Gets the role name at the source end of the relationship.

System_CAPS_pubpropertyTargetRoleName

Gets the role name at the target end of the relationship.

NameDescription
System_CAPS_pubmethodAdd(IEntityWithRelationships^)

Adds an object to the related end.

System_CAPS_pubmethodAdd(Object^)

Adds an object to the related end.

System_CAPS_pubmethodAttach(IEntityWithRelationships^)

Defines a relationship between two attached objects.

System_CAPS_pubmethodAttach(Object^)

Defines a relationship between two attached objects.

System_CAPS_pubmethodCreateSourceQuery()

Returns an IEnumerable that represents the objects that belong to the related end.

System_CAPS_pubmethodGetEnumerator()

Returns an IEnumerator that iterates through the collection of related objects.

System_CAPS_pubmethodLoad()

Loads the related object or objects into this related end with the default merge option.

System_CAPS_pubmethodLoad(MergeOption)

Loads the related object or objects into the related end with the specified merge option.

System_CAPS_pubmethodRemove(IEntityWithRelationships^)

Removes an object from the collection of objects at the related end.

System_CAPS_pubmethodRemove(Object^)

Removes an object from the collection of objects at the related end.

IRelatedEnd defines the requirements for an object that represents an end in an association. This interface is implemented by the RelatedEnd class. RelatedEnd is the base class for the EntityCollection<TEntity> and EntityReference<TEntity> classes.

The example in this topic is based on the AdventureWorks Sales Model, which was generated by the Entity Data Model Wizard.

The following example adds new SalesOrderHeader entities to the Contact entity. Then it gets all related ends from the Contact entity and displays relationship name, source role name, and target role name for each related end.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 3.5
Return to top
Show: