IRelatedEnd.Attach 方法

定義

定義兩個所附加物件之間的關聯性。

多載

Attach(IEntityWithRelationships)

定義兩個所附加物件之間的關聯性。

Attach(Object)

定義兩個所附加物件之間的關聯性。

Attach(IEntityWithRelationships)

定義兩個所附加物件之間的關聯性。

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)

參數

entity
IEntityWithRelationships

正在附加的物件。 entity 必須實作 IEntityWithRelationships

備註

Attach 方法是用來定義同時附加至相同 ObjectContext 執行個體之兩個物件之間的關聯性。

RelatedEnd 類別會明確實作 Attach 方法。 EntityCollection<TEntity> 類別會使用這個實作來定義所附加來源物件與附加至集合之物件之間的關聯性。 如需詳細資訊,請參閱 附加和卸離物件

適用於

Attach(Object)

定義兩個所附加物件之間的關聯性。

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

參數

entity
Object

正在附加的物件。

備註

針對未實 IEntityWithRelationships 作 的實體類別,請使用這個方法多載。 針對 AttachIEntityWithRelationships 作 的實體類別使用 方法。

Attach 方法是用來定義同時附加至相同 ObjectContext 執行個體之兩個物件之間的關聯性。

RelatedEnd 類別會明確實作 Attach 方法。 EntityCollection<TEntity> 類別會使用這個實作來定義所附加來源物件與附加至集合之物件之間的關聯性。 如需詳細資訊,請參閱 附加和卸離物件

適用於