Condividi tramite


Metodo DbEntityEntry<TEntity>.Collection<TElement> (Expression<Func<TEntity, ICollection<TElement>>>)

[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.]

Ottiene un oggetto che rappresenta la proprietà di navigazione della raccolta da questa entità a una raccolta di entità correlate.

Spazio dei nomi:  System.Data.Entity.Infrastructure
Assembly:  EntityFramework (in EntityFramework.dll)

Sintassi

'Dichiarazione
<SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")> _
Public Function Collection(Of TElement As Class) ( _
    navigationProperty As Expression(Of Func(Of TEntity, ICollection(Of TElement))) _
) As DbCollectionEntry(Of TEntity, TElement)
'Utilizzo
Dim instance As DbEntityEntry 
Dim navigationProperty As Expression(Of Func(Of TEntity, ICollection(Of TElement)))
Dim returnValue As DbCollectionEntry(Of TEntity, TElement)

returnValue = instance.Collection(navigationProperty)
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public DbCollectionEntry<TEntity, TElement> Collection<TElement>(
    Expression<Func<TEntity, ICollection<TElement>>> navigationProperty
)
where TElement : class
[SuppressMessageAttribute(L"Microsoft.Design", L"CA1006:DoNotNestGenericTypesInMemberSignatures")]
public:
generic<typename TElement>
where TElement : ref class 
DbCollectionEntry<TEntity, TElement>^ Collection(
    Expression<Func<TEntity, ICollection<TElement>^>^>^ navigationProperty
)
[<SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")>]
member Collection : 
        navigationProperty:Expression<Func<'TEntity, ICollection<'TElement>>> -> DbCollectionEntry<'TEntity, 'TElement>  when 'TElement : not struct
JScript does not support generic types and methods.

Parametri di tipo

  • TElement
    Tipo di elementi contenuti nella raccolta.

Parametri

Valore restituito

Tipo: System.Data.Entity.Infrastructure.DbCollectionEntry<TEntity, TElement>
Oggetto che rappresenta la proprietà di navigazione.

Vedere anche

Riferimento

DbEntityEntry<TEntity> Classe

Overload Collection

Spazio dei nomi System.Data.Entity.Infrastructure