RelatedEnd.IRelatedEnd.Add 方法 (Object)
[此頁面專屬於 Entity Framework 第 6 版。最新版本可從 'Entity Framework' NuGet 套件取得。如需 Entity Framework 的詳細資訊,請參閱 msdn.com/data/ef。]
將實體加入至相關端。 如果將擁有者附加到快取,則會將所有連接的端點加入至該物件快取,同時將其對應的關係加入至 ObjectStateManager。 關聯性的 RelatedEnd 也是固定的。
命名空間: System.Data.Entity.Core.Objects.DataClasses
組件: EntityFramework (在 EntityFramework.dll 中)
語法
'宣告
<SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")> _
Private Sub Add ( _
entity As Object _
) Implements IRelatedEnd.Add
'用途
Dim instance As RelatedEnd
Dim entity As Object
CType(instance, IRelatedEnd).Add(entity)
[SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
void IRelatedEnd.Add(
Object entity
)
[SuppressMessageAttribute(L"Microsoft.Design", L"CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
private:
virtual void Add(
Object^ entity
) sealed = IRelatedEnd::Add
[<SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")>]
private abstract Add :
entity:Object -> unit
[<SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")>]
private override Add :
entity:Object -> unit
JScript supports the use of explicit interface implementations, but not the declarations of new ones.
參數
- entity
類型:System.Object
要加入至相關端的實體執行個體