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)

void Associate(
	EntityInstanceCollection sourceEntityInstances,
	IEntityInstance destinationEntityInstance,
	IAssociation association,
	ILobSystemInstance lobSystemInstance


Type: Microsoft.BusinessData.Runtime.EntityInstanceCollection

The source instances.

Type: Microsoft.BusinessData.Runtime.IEntityInstance

The destination instance.

Type: Microsoft.BusinessData.MetadataModel.IAssociation

The association to use.

Type: Microsoft.BusinessData.MetadataModel.ILobSystemInstance

The external system instance to connect to.

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.