Metodo RelatedEnd.IRelatedEnd.Attach (IEntityWithRelationships)
[Questa pagina è specifica della versione 6 di Entity Framework. La versione più recente è disponibile come pacchetto NuGet per "Entity Framework". Per ulteriori informazioni su Entity Framework, vedere la pagina msdn.com/data/ef.]
Collega un'entità all'entità finale correlata. Questo metodo funziona esattamente come Attach(object). Viene mantenuto per garantire la compatibilità con le versioni precedenti di IRelatedEnd.
Spazio dei nomi: System.Data.Entity.Core.Objects.DataClasses
Assembly: EntityFramework (in EntityFramework.dll)
Sintassi
'Dichiarazione
<SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")> _
Private Sub Attach ( _
entity As IEntityWithRelationships _
) Implements IRelatedEnd.Attach
'Utilizzo
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.
Parametri
- entity
Tipo: System.Data.Entity.Core.Objects.DataClasses.IEntityWithRelationships
Entità da collegare all'entità correlata
Implements
IRelatedEnd.Attach(IEntityWithRelationships)
Eccezioni
Eccezione | Condizione |
---|---|
ArgumentNullException | Generata quando entity è Null. |
InvalidOperationException | Generata quando l'entità non può essere correlata attraverso l'entità finale della relazione corrente. |