RelatedEnd.IRelatedEnd.Attach-Methode (IEntityWithRelationships)
[Diese Seite bezieht sich auf Entity Framework Version 6. Die neueste Version ist als 'Entity Framework' NuGet-Paket verfügbar. Weitere Informationen zu Entity Framework finden Sie unter msdn.com/data/ef.]
Fügt dem verknüpften Ende eine Entität an. Diese Methode funktioniert genau auf die gleiche Weise wie Attach(object). Es wird aus Gründen der Abwärtskompatibilität mit früheren Versionen von IRelatedEnd verwaltet.
Namespace: System.Data.Entity.Core.Objects.DataClasses
Assembly: EntityFramework (in EntityFramework.dll)
Syntax
'Declaration
<SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")> _
Private Sub Attach ( _
entity As IEntityWithRelationships _
) Implements IRelatedEnd.Attach
'Usage
Dim instance As RelatedEnd
Dim entity As IEntityWithRelationships
CType(instance, IRelatedEnd).Attach(entity)
[SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
void IRelatedEnd.Attach(
IEntityWithRelationships entity
)
[SuppressMessageAttribute(L"Microsoft.Design", L"CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
private:
virtual void Attach(
IEntityWithRelationships^ entity
) sealed = IRelatedEnd::Attach
[<SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")>]
private abstract Attach :
entity:IEntityWithRelationships -> unit
[<SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")>]
private override Attach :
entity:IEntityWithRelationships -> unit
JScript supports the use of explicit interface implementations, but not the declarations of new ones.
Parameter
- entity
Typ: System.Data.Entity.Core.Objects.DataClasses.IEntityWithRelationships
Die Entität, die dem verknüpften Ende angefügt werden soll.
Implements
IRelatedEnd.Attach(IEntityWithRelationships)
Ausnahmen
Ausnahme | Bedingung |
---|---|
ArgumentNullException | Wird ausgelöst, wenn entity NULL ist. |
InvalidOperationException | Wird ausgelöst, wenn die Entität nicht über das aktuelle Beziehungsende verknüpft werden kann. |