Muokkaa

Jaa


IRelatedEnd.Attach Method

Definition

Defines a relationship between two attached objects.

Overloads

Attach(IEntityWithRelationships)

Defines a relationship between two attached objects.

Attach(Object)

Defines a relationship between two attached objects.

Attach(IEntityWithRelationships)

Defines a relationship between two attached objects.

public:
 void Attach(System::Data::Objects::DataClasses::IEntityWithRelationships ^ entity);
public void Attach (System.Data.Objects.DataClasses.IEntityWithRelationships entity);
abstract member Attach : System.Data.Objects.DataClasses.IEntityWithRelationships -> unit
Public Sub Attach (entity As IEntityWithRelationships)

Parameters

entity
IEntityWithRelationships

The object being attached. entity must implement IEntityWithRelationships.

Remarks

The Attach method is used to define a relationship between two objects that are both attached to the same ObjectContext instance.

The RelatedEnd class explicitly implements the Attach method. The EntityCollection<TEntity> class uses this implementation to define relationships between the attached source object and the object attached to the collection. For more information, see Attaching and Detaching Objects.

Applies to

Attach(Object)

Defines a relationship between two attached objects.

public:
 void Attach(System::Object ^ entity);
public void Attach (object entity);
abstract member Attach : obj -> unit
Public Sub Attach (entity As Object)

Parameters

entity
Object

The object being attached.

Remarks

Use this method overload for entity classes that do not implement IEntityWithRelationships. Use the Attach method for entity classes that do implement IEntityWithRelationships.

The Attach method is used to define a relationship between two objects that are both attached to the same ObjectContext instance.

The RelatedEnd class explicitly implements the Attach method. The EntityCollection<TEntity> class uses this implementation to define relationships between the attached source object and the object attached to the collection. For more information, see Attaching and Detaching Objects.

Applies to