EntityCollection<TEntity> 建構函式

定義

初始化 EntityCollection<TEntity> 類別的新執行個體。Initializes a new instance of the EntityCollection<TEntity> class.

public:
 EntityCollection();
public EntityCollection ();
Public Sub New ()

備註

EntityCollection<TEntity> 的這個公用建構函式 (Constructor) 是要在還原序列化物件圖形時供物件服務使用。This public constructor for EntityCollection<TEntity> is intended to be used by Object Services when deserializing object graphs. 您應該從導覽屬性中存取 EntityCollection<TEntity> 的執行個體,而非使用這個建構函式。You should access an instance of EntityCollection<TEntity> from a navigation property instead of using this constructor.

若要儲存特定實體類型之物件的不相關集合 (例如 ObjectQuery<T> 的結果),請使用 List<T> 的執行個體。To store an unrelated collection of objects of a specific entity type, such as the result of an ObjectQuery<T>, use an instance of List<T>.

適用於