EntityEntry<TEntity>.Collection 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
| 名稱 | Description |
|---|---|
| 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
收藏導航。
傳回
一個揭露該導航屬性變更追蹤資訊與操作的物件。
備註
更多資訊與範例請參閱 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 表達式,代表集合導航,用於存取資訊與操作。
傳回
一個揭露該導航屬性變更追蹤資訊與操作的物件。
備註
更多資訊與範例請參閱 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
導覽屬性的名稱。
傳回
一個揭露該導航屬性變更追蹤資訊與操作的物件。
備註
更多資訊與範例請參閱 EF Core 中的「存取追蹤實體 」及 「變更外鍵與導覽 」。