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 中访问跟踪的实体更改外键和导航

适用于