IEntity.Associate Method
Associates the given source external items with the given destination external item.
Namespace: Microsoft.BusinessData.MetadataModel
Assembly: Microsoft.BusinessData (in Microsoft.BusinessData.dll)
Syntax
'Declaration
Sub Associate ( _
sourceEntityInstances As EntityInstanceCollection, _
destinationEntityInstance As IEntityInstance, _
association As IAssociation, _
lobSystemInstance As ILobSystemInstance _
)
'Usage
Dim instance As IEntity
Dim sourceEntityInstances As EntityInstanceCollection
Dim destinationEntityInstance As IEntityInstance
Dim association As IAssociation
Dim lobSystemInstance As ILobSystemInstance
instance.Associate(sourceEntityInstances, _
destinationEntityInstance, association, _
lobSystemInstance)
void Associate(
EntityInstanceCollection sourceEntityInstances,
IEntityInstance destinationEntityInstance,
IAssociation association,
ILobSystemInstance lobSystemInstance
)
Parameters
sourceEntityInstances
Type: Microsoft.BusinessData.Runtime.EntityInstanceCollectionThe source instances.
destinationEntityInstance
Type: Microsoft.BusinessData.Runtime.IEntityInstanceThe destination instance.
association
Type: Microsoft.BusinessData.MetadataModel.IAssociationThe association to use.
lobSystemInstance
Type: Microsoft.BusinessData.MetadataModel.ILobSystemInstanceThe external system instance to connect to.
Remarks
The association provided as an input to this method must be either an Associator or it must be contained by an AssociationGroup that contains an Associator. This method requires an external item for every source external content type of the Associator, and an external instance for the destination external content type of the Associator.
This method is supported only for Associations that are not based on foreign keys.
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.
Examples
Code Snippet: Execute the Associator and Disassociator Method Instances of an External Content Type