IRelatedEnd.Attach 方法 (IEntityWithRelationships)
[此頁面專屬於 Entity Framework 第 6 版。最新版本可從 'Entity Framework' NuGet 套件取得。如需 Entity Framework 的詳細資訊,請參閱 msdn.com/data/ef。]
定義兩個所附加物件之間的關聯性。
命名空間: System.Data.Entity.Core.Objects.DataClasses
組件: EntityFramework (在 EntityFramework.dll 中)
語法
'宣告
Sub Attach ( _
entity As IEntityWithRelationships _
)
'用途
Dim instance As IRelatedEnd
Dim entity As IEntityWithRelationships
instance.Attach(entity)
void Attach(
IEntityWithRelationships entity
)
void Attach(
IEntityWithRelationships^ entity
)
abstract Attach :
entity:IEntityWithRelationships -> unit
function Attach(
entity : IEntityWithRelationships
)
參數
- entity
類型:System.Data.Entity.Core.Objects.DataClasses.IEntityWithRelationships
正在附加的物件。 實體必須實作 IEntityWithRelationships。