Share via


EntityEntry<TEntity>.Collection 方法

定義

多載

Collection<TProperty>(INavigationBase)

提供集合導覽屬性變更追蹤和載入資訊的存取權,該屬性會將這個實體與另一個實體的集合產生關聯。

Collection<TProperty>(Expression<Func<TEntity,IEnumerable<TProperty>>>)

提供集合導覽屬性變更追蹤和載入資訊的存取權,該屬性會將這個實體與另一個實體的集合產生關聯。

Collection<TProperty>(String)

提供集合導覽屬性變更追蹤和載入資訊的存取權,該屬性會將這個實體與另一個實體的集合產生關聯。

Collection<TProperty>(INavigationBase)

提供集合導覽屬性變更追蹤和載入資訊的存取權,該屬性會將這個實體與另一個實體的集合產生關聯。

public virtual Microsoft.EntityFrameworkCore.ChangeTracking.CollectionEntry<TEntity,TProperty> Collection<TProperty> (Microsoft.EntityFrameworkCore.Metadata.INavigationBase navigation) where TProperty : class;
override this.Collection : Microsoft.EntityFrameworkCore.Metadata.INavigationBase -> Microsoft.EntityFrameworkCore.ChangeTracking.CollectionEntry<'Entity, 'Property (requires 'Entity : null and 'Property : null)> (requires 'Property : null)
Public Overridable Function Collection(Of TProperty As Class) (navigation As INavigationBase) As CollectionEntry(Of TEntity, TProperty)

類型參數

TProperty

參數

navigation
INavigationBase

集合導覽。

傳回

CollectionEntry<TEntity,TProperty>

物件,公開指定導覽屬性的變更追蹤資訊和作業。

備註

如需詳細資訊和範例,請參閱 存取 EF Core 中的追蹤實體變更外鍵和導覽

適用於

Collection<TProperty>(Expression<Func<TEntity,IEnumerable<TProperty>>>)

提供集合導覽屬性變更追蹤和載入資訊的存取權,該屬性會將這個實體與另一個實體的集合產生關聯。

public virtual Microsoft.EntityFrameworkCore.ChangeTracking.CollectionEntry<TEntity,TProperty> Collection<TProperty> (System.Linq.Expressions.Expression<Func<TEntity,System.Collections.Generic.IEnumerable<TProperty>>> propertyExpression) where TProperty : class;
override this.Collection : System.Linq.Expressions.Expression<Func<'Entity, seq<'Property>>> -> Microsoft.EntityFrameworkCore.ChangeTracking.CollectionEntry<'Entity, 'Property (requires 'Entity : null and 'Property : null)> (requires 'Property : null)
Public Overridable Function Collection(Of TProperty As Class) (propertyExpression As Expression(Of Func(Of TEntity, IEnumerable(Of TProperty)))) As CollectionEntry(Of TEntity, TProperty)

類型參數

TProperty

參數

propertyExpression
Expression<Func<TEntity,IEnumerable<TProperty>>>

Lambda 運算式,表示存取訊號和作業的集合導覽。

傳回

CollectionEntry<TEntity,TProperty>

物件,公開指定導覽屬性的變更追蹤資訊和作業。

備註

如需詳細資訊和範例,請參閱 存取 EF Core 中的追蹤實體變更外鍵和導覽

適用於

Collection<TProperty>(String)

提供集合導覽屬性變更追蹤和載入資訊的存取權,該屬性會將這個實體與另一個實體的集合產生關聯。

public virtual Microsoft.EntityFrameworkCore.ChangeTracking.CollectionEntry<TEntity,TProperty> Collection<TProperty> (string propertyName) where TProperty : class;
override this.Collection : string -> Microsoft.EntityFrameworkCore.ChangeTracking.CollectionEntry<'Entity, 'Property (requires 'Entity : null and 'Property : null)> (requires 'Property : null)
Public Overridable Function Collection(Of TProperty As Class) (propertyName As String) As CollectionEntry(Of TEntity, TProperty)

類型參數

TProperty

參數

propertyName
String

導覽屬性的名稱。

傳回

CollectionEntry<TEntity,TProperty>

物件,公開指定導覽屬性的變更追蹤資訊和作業。

備註

如需詳細資訊和範例,請參閱 存取 EF Core 中的追蹤實體變更外鍵和導覽

適用於