次の方法で共有


DbEntityEntry<TEntity>.Collection<TElement> メソッド (Expression<Func<TEntity, ICollection<TElement>>>)

[このページは、Entity Framework 6 に関するページです。最新バージョンは、'Entity Framework' NuGet パッケージとして入手できます。Entity Framework の詳細については、msdn.com/data/ef を参照してください。]

このエンティティから関連するエンティティのコレクションへのコレクション ナビゲーション プロパティを表すオブジェクトを取得します。

名前空間:  System.Data.Entity.Infrastructure
アセンブリ:  EntityFramework (EntityFramework.dll 内)

構文

'宣言
<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)
'使用
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.

型パラメーター

  • TElement
    コレクション内の要素の型。

パラメーター

戻り値

型 : System.Data.Entity.Infrastructure.DbCollectionEntry<TEntity, TElement>
ナビゲーション プロパティを表すオブジェクト。

参照

参照

DbEntityEntry<TEntity> クラス

Collection オーバーロード

System.Data.Entity.Infrastructure 名前空間