RelatedEnd.IRelatedEnd.Attach 方法

定義

在相關端附加物件。Attaches an object at the related end.

多載

IRelatedEnd.Attach(IEntityWithRelationships)

在相關端附加物件。Attaches an object at the related end.

IRelatedEnd.Attach(Object)

將物件附加至相關端。Attaches an object to the related end.

IRelatedEnd.Attach(IEntityWithRelationships)

在相關端附加物件。Attaches an object at the related end.

 virtual void System.Data.Objects.DataClasses.IRelatedEnd.Attach(System::Data::Objects::DataClasses::IEntityWithRelationships ^ entity) = System::Data::Objects::DataClasses::IRelatedEnd::Attach;
void IRelatedEnd.Attach (System.Data.Objects.DataClasses.IEntityWithRelationships entity);
abstract member System.Data.Objects.DataClasses.IRelatedEnd.Attach : System.Data.Objects.DataClasses.IEntityWithRelationships -> unit
override this.System.Data.Objects.DataClasses.IRelatedEnd.Attach : System.Data.Objects.DataClasses.IEntityWithRelationships -> unit
Sub Attach (entity As IEntityWithRelationships) Implements IRelatedEnd.Attach

參數

entity
IEntityWithRelationships

正在附加的物件。The object being attached.

實作

備註

這個成員是明確介面成員實作,This member is an explicit interface member implementation. 只有在 RelatedEnd 執行個體轉換成 IRelatedEnd 介面時,才能使用這個成員。It can be used only when the RelatedEnd instance is cast to an IRelatedEnd interface.

IRelatedEnd.Attach方法只會針對與舊版 .NET Framework 的相容性進行維護。The IRelatedEnd.Attach method is only maintained for compatibility with previous versions of the .NET Framework.

適用於

IRelatedEnd.Attach(Object)

將物件附加至相關端。Attaches an object to the related end.

 virtual void System.Data.Objects.DataClasses.IRelatedEnd.Attach(System::Object ^ entity) = System::Data::Objects::DataClasses::IRelatedEnd::Attach;
void IRelatedEnd.Attach (object entity);
abstract member System.Data.Objects.DataClasses.IRelatedEnd.Attach : obj -> unit
override this.System.Data.Objects.DataClasses.IRelatedEnd.Attach : obj -> unit
Sub Attach (entity As Object) Implements IRelatedEnd.Attach

參數

entity
Object

要附加至相關端的實體執行個體。An entity instance to attach to the related end.

實作

備註

如果相關端已經附加一些實體,現有的實體將會與新實體合併。If the related end already has some entities attached to it, the existing entities will be merged with the new entity. 新的實體不會被假設為相關實體物件的完整集合。The new entity is not assumed to be the complete set of related entity objects.

來源實體物件和傳入的所有實體物件都必須處於 Unchanged 或狀態中 ModifiedThe source entity object and all entity objects passed in must be in an Unchanged or Modified state. 只有當狀態管理員已經在追蹤關聯性實例時,才允許已刪除的元素。Deleted elements are allowed only when the state manager is already tracking the relationship instance.

適用於