Share via


EntityReference<TEntity>.Attach(TEntity) Method

Definition

Creates a many-to-one or one-to-one relationship between two objects in the object context.

public void Attach(TEntity entity);
override this.Attach : 'Entity -> unit
Public Sub Attach (entity As TEntity)

Parameters

entity
TEntity

The object being attached.

Exceptions

When the entity is null.

When the entity cannot be related to the current related end. This can occur when the association in the conceptual schema does not support a relationship between the two types.

Applies to