Compartilhar via


IEntity.FindAssociated Method (EntityInstanceCollection, IAssociation, IFilterCollection, ILobSystemInstance, OperationMode)

Gets the external items that are associated with the specified source external items and association, filtered by the specified criteria, using the specified mode of operation.

Namespace:  Microsoft.BusinessData.MetadataModel
Assembly:  Microsoft.BusinessData (in Microsoft.BusinessData.dll)

Syntax

'Declaration
Function FindAssociated ( _
    sourceEntityInstances As EntityInstanceCollection, _
    association As IAssociation, _
    filterCollection As IFilterCollection, _
    lobSystemInstance As ILobSystemInstance, _
    mode As OperationMode _
) As IEntityInstanceEnumerator
'Usage
Dim instance As IEntity
Dim sourceEntityInstances As EntityInstanceCollection
Dim association As IAssociation
Dim filterCollection As IFilterCollection
Dim lobSystemInstance As ILobSystemInstance
Dim mode As OperationMode
Dim returnValue As IEntityInstanceEnumerator

returnValue = instance.FindAssociated(sourceEntityInstances, _
    association, filterCollection, lobSystemInstance, _
    mode)
IEntityInstanceEnumerator FindAssociated(
    EntityInstanceCollection sourceEntityInstances,
    IAssociation association,
    IFilterCollection filterCollection,
    ILobSystemInstance lobSystemInstance,
    OperationMode mode
)

Parameters

Return Value

Type: Microsoft.BusinessData.Runtime.IEntityInstanceEnumerator
An enumerator to the external items.

Remarks

The association provided as an input to this method must be an AssociationNavigator. FindAssociated requires an external item for every source external content type of the AssociationNavigator and will return external items based on the destination external content type of the AssociationNavigator that are associated with the given external items.

This method can potentially return a lot of external items. IFilterCollection can be specified to filter the results and optimize the behavior. For more information about how to use filters, see IFilterCollection.

This method returns an IEntityInstanceEnumerator, which requires special clean up and may expose additional functionality to control the behavior when the external system returns data in batches. For more information about how to use external item enumerators, see IEntityInstanceEnumerator.

The mode of operation can be specified for this method. For more information about how to use operation modes, see OperationMode.

Instances of objects in the Business Data Connectivity object model are tied to the Metadata Store they are obtained from. Using instances tied to one Metadata Store with the instances from another Metadata Store will cause data corruption and other unexpected behavior. For more information, see DatabaseBackedMetadataCatalog, FileBackedMetadataCatalog, and RemoteSharedFileBackedMetadataCatalog.

See Also

Reference

IEntity Interface

IEntity Members

FindAssociated Overload

Microsoft.BusinessData.MetadataModel Namespace