通过


EntityCollection<TEntity>.Count 属性

定义

获取集合中包含的对象数。

public:
 property int Count { int get(); };
public int Count { get; }
member this.Count : int
member this.Count : int
Public ReadOnly Property Count As Integer

属性值

中包含的 EntityCollection<TEntity>元素数。

实现

注解

Count 属性获取本地集合中当前实体的数量,并且不反映数据源中集合的大小。 零的计数不一定指示相关集合为空。 若要确定数据源中的集合大小,请调用 Load 该方法或在查询路径中包含相关对象。 有关详细信息,请参阅 “加载相关对象”。

适用于