EntitySet<TEntity> EntitySet<TEntity> EntitySet<TEntity> EntitySet<TEntity> Class

定義

提供延後載入和關聯性維護,以用於 LINQ to SQL 應用程式中一對多和一對一關聯性的集合端。Provides for deferred loading and relationship maintenance for the collection side of one-to-many and one-to-one relationships in a LINQ to SQL applications.

generic <typename TEntity>
 where TEntity : classpublic ref class EntitySet sealed : System::Collections::Generic::ICollection<TEntity>, System::Collections::Generic::IEnumerable<TEntity>, System::Collections::Generic::IList<TEntity>, System::Collections::IList, System::ComponentModel::IListSource
public sealed class EntitySet<TEntity> : System.Collections.Generic.ICollection<TEntity>, System.Collections.Generic.IEnumerable<TEntity>, System.Collections.Generic.IList<TEntity>, System.Collections.IList, System.ComponentModel.IListSource where TEntity : class
type EntitySet<'Entity (requires 'Entity : null)> = class
    interface ICollection
    interface ICollection<'Entity (requires 'Entity : null)>
    interface IEnumerable
    interface seq<'Entity (requires 'Entity : null)>
    interface IList
    interface IList<'Entity (requires 'Entity : null)>
    interface IListSource
Public NotInheritable Class EntitySet(Of TEntity)
Implements ICollection(Of TEntity), IEnumerable(Of TEntity), IList, IList(Of TEntity), IListSource

類型參數

TEntity

目標實體的資料型別。The data type of the target entity.

繼承
EntitySet<TEntity>EntitySet<TEntity>EntitySet<TEntity>EntitySet<TEntity>
實作

備註

這個類別會與EntityRef<TEntity>搭配使用。This class is used in combination with EntityRef<TEntity>.

建構函式

EntitySet<TEntity>() EntitySet<TEntity>() EntitySet<TEntity>() EntitySet<TEntity>()

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

EntitySet<TEntity>(Action<TEntity>, Action<TEntity>) EntitySet<TEntity>(Action<TEntity>, Action<TEntity>) EntitySet<TEntity>(Action<TEntity>, Action<TEntity>) EntitySet<TEntity>(Action<TEntity>, Action<TEntity>)

初始化 EntitySet<TEntity> 類別的新執行個體,同時提供加入和移除作業的處理常式。Initializes a new instance of the EntitySet<TEntity> class while supplying handlers for add and remove operations.

屬性

Count Count Count Count

取得 EntitySet<TEntity> 集合中的實體數目。Gets the number of entities in the EntitySet<TEntity> collection.

HasAssignedValues HasAssignedValues HasAssignedValues HasAssignedValues
HasLoadedOrAssignedValues HasLoadedOrAssignedValues HasLoadedOrAssignedValues HasLoadedOrAssignedValues

指定 EntitySet<TEntity> 是否已載入或指派值。Specifies whether the EntitySet<TEntity> has loaded or assigned a value.

HasLoadedValues HasLoadedValues HasLoadedValues HasLoadedValues
IsDeferred IsDeferred IsDeferred IsDeferred

指定這個 EntitySet<TEntity> 是否擁有尚未執行的延後查詢。Specifies whether this EntitySet<TEntity> has a deferred query that has not yet executed.

Item[Int32] Item[Int32] Item[Int32] Item[Int32]

在指定的索引位置上取得或設定項目。Gets or sets the element at the specified index.

方法

Add(TEntity) Add(TEntity) Add(TEntity) Add(TEntity)

加入實體。Adds an entity.

AddRange(IEnumerable<TEntity>) AddRange(IEnumerable<TEntity>) AddRange(IEnumerable<TEntity>) AddRange(IEnumerable<TEntity>)

加入實體的集合。Adds a collection of entities.

Assign(IEnumerable<TEntity>) Assign(IEnumerable<TEntity>) Assign(IEnumerable<TEntity>) Assign(IEnumerable<TEntity>)

EntitySet<TEntity> 集合指派給另一個 EntitySet<TEntity> 集合。Assigns an EntitySet<TEntity> collection to another EntitySet<TEntity> collection.

Clear() Clear() Clear() Clear()

移除所有項目。Removes all items.

Contains(TEntity) Contains(TEntity) Contains(TEntity) Contains(TEntity)

指定 EntitySet<TEntity> 是否包含特定實體。Specifies whether the EntitySet<TEntity> contains a specific entity.

CopyTo(TEntity[], Int32) CopyTo(TEntity[], Int32) CopyTo(TEntity[], Int32) CopyTo(TEntity[], Int32)

EntitySet<TEntity> 複製至陣列。Copies the EntitySet<TEntity> to an array.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator()

傳回逐一查看集合的列舉值。Returns an enumerator that iterates through a collection.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(Inherited from Object)
GetNewBindingList() GetNewBindingList() GetNewBindingList() GetNewBindingList()

建立新清單以繫結至資料來源。Creates a new list for binding to a data source.

GetType() GetType() GetType() GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(Inherited from Object)
IndexOf(TEntity) IndexOf(TEntity) IndexOf(TEntity) IndexOf(TEntity)

傳回實體的索引。Returns the index of the entity.

Insert(Int32, TEntity) Insert(Int32, TEntity) Insert(Int32, TEntity) Insert(Int32, TEntity)

在索引位置插入實體。Inserts an entity at an index position.

Load() Load() Load() Load()

載入 EntitySet<TEntity>Loads the EntitySet<TEntity>.

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(Inherited from Object)
Remove(TEntity) Remove(TEntity) Remove(TEntity) Remove(TEntity)

移除實體。Removes an entity.

RemoveAt(Int32) RemoveAt(Int32) RemoveAt(Int32) RemoveAt(Int32)

移除在指定之索引處的實體。Removes an entity at a specified index.

SetSource(IEnumerable<TEntity>) SetSource(IEnumerable<TEntity>) SetSource(IEnumerable<TEntity>) SetSource(IEnumerable<TEntity>)

設定 EntitySet<TEntity> 的來源。Sets the source of the EntitySet<TEntity>.

ToString() ToString() ToString() ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(Inherited from Object)

事件

ListChanged ListChanged ListChanged ListChanged

發生於清單的內容變更時。Occurs when the contents of a list are changed.

明確介面實作

ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32)

如需這個成員的說明,請參閱 CopyTo(Array, Int32)For a description of this member, see CopyTo(Array, Int32).

ICollection.Count ICollection.Count ICollection.Count ICollection.Count
ICollection.IsSynchronized ICollection.IsSynchronized ICollection.IsSynchronized ICollection.IsSynchronized

如需這個成員的說明,請參閱 IsSynchronizedFor a description of this member, see IsSynchronized.

ICollection.SyncRoot ICollection.SyncRoot ICollection.SyncRoot ICollection.SyncRoot

如需這個成員的說明,請參閱 SyncRootFor a description of this member, see SyncRoot.

ICollection<TEntity>.IsReadOnly ICollection<TEntity>.IsReadOnly ICollection<TEntity>.IsReadOnly ICollection<TEntity>.IsReadOnly

如需這個成員的說明,請參閱 IsReadOnlyFor a description of this member, see IsReadOnly.

IEnumerable.GetEnumerator() IEnumerable.GetEnumerator() IEnumerable.GetEnumerator() IEnumerable.GetEnumerator()

如需這個成員的說明,請參閱 GetEnumerator()For a description of this member, see GetEnumerator().

IList.Add(Object) IList.Add(Object) IList.Add(Object) IList.Add(Object)

如需這個成員的說明,請參閱 Add(Object)For a description of this member, see Add(Object).

IList.Clear() IList.Clear() IList.Clear() IList.Clear()
IList.Contains(Object) IList.Contains(Object) IList.Contains(Object) IList.Contains(Object)

如需這個成員的說明,請參閱 Contains(Object)For a description of this member, see Contains(Object).

IList.IndexOf(Object) IList.IndexOf(Object) IList.IndexOf(Object) IList.IndexOf(Object)

如需這個成員的說明,請參閱 IndexOf(Object)For a description of this member, see IndexOf(Object).

IList.Insert(Int32, Object) IList.Insert(Int32, Object) IList.Insert(Int32, Object) IList.Insert(Int32, Object)

如需這個成員的說明,請參閱 Insert(Int32, Object)For a description of this member, see Insert(Int32, Object).

IList.IsFixedSize IList.IsFixedSize IList.IsFixedSize IList.IsFixedSize

如需這個成員的說明,請參閱 IsFixedSizeFor a description of this member, see IsFixedSize.

IList.IsReadOnly IList.IsReadOnly IList.IsReadOnly IList.IsReadOnly

如需這個成員的說明,請參閱 IsReadOnlyFor a description of this member, see IsReadOnly.

IList.Item[Int32] IList.Item[Int32] IList.Item[Int32] IList.Item[Int32]

如需這個成員的說明,請參閱 Item[Int32]For a description of this member, see Item[Int32].

IList.Remove(Object) IList.Remove(Object) IList.Remove(Object) IList.Remove(Object)

如需這個成員的說明,請參閱 Remove(Object)For a description of this member, see Remove(Object).

IList.RemoveAt(Int32) IList.RemoveAt(Int32) IList.RemoveAt(Int32) IList.RemoveAt(Int32)
IListSource.ContainsListCollection IListSource.ContainsListCollection IListSource.ContainsListCollection IListSource.ContainsListCollection

如需這個成員的說明,請參閱 ContainsListCollectionFor a description of this member, see ContainsListCollection.

IListSource.GetList() IListSource.GetList() IListSource.GetList() IListSource.GetList()

如需這個成員的說明,請參閱 GetList()For a description of this member, see GetList().

擴充方法

CopyToDataTable<T>(IEnumerable<T>) CopyToDataTable<T>(IEnumerable<T>) CopyToDataTable<T>(IEnumerable<T>) CopyToDataTable<T>(IEnumerable<T>)

根據輸入 DataTable 物件 (其中泛型參數 TDataRow) 傳回包含 IEnumerable<T> 物件複本的 DataRowReturns a DataTable that contains copies of the DataRow objects, given an input IEnumerable<T> object where the generic parameter T is DataRow.

CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption) CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption) CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption) CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption)

根據輸入 DataRow 物件 (其中泛型參數 TDataTable),將 IEnumerable<T> 物件複製到指定的 DataRowCopies DataRow objects to the specified DataTable, given an input IEnumerable<T> object where the generic parameter T is DataRow.

CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption, FillErrorEventHandler) CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption, FillErrorEventHandler) CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption, FillErrorEventHandler) CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption, FillErrorEventHandler)

根據輸入 DataRow 物件 (其中泛型參數 TDataTable),將 IEnumerable<T> 物件複製到指定的 DataRowCopies DataRow objects to the specified DataTable, given an input IEnumerable<T> object where the generic parameter T is DataRow.

Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable)

IEnumerable 的項目轉換成指定的型別。Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable)

根據指定的型別來篩選 IEnumerable 的項目。Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable)

啟用查詢的平行化作業。Enables parallelization of a query.

AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable)

IEnumerable 轉換成 IQueryableConverts an IEnumerable to an IQueryable.

Ancestors<T>(IEnumerable<T>) Ancestors<T>(IEnumerable<T>) Ancestors<T>(IEnumerable<T>) Ancestors<T>(IEnumerable<T>)

傳回包含來源集合中每個節點祖系的項目集合。Returns a collection of elements that contains the ancestors of every node in the source collection.

Ancestors<T>(IEnumerable<T>, XName) Ancestors<T>(IEnumerable<T>, XName) Ancestors<T>(IEnumerable<T>, XName) Ancestors<T>(IEnumerable<T>, XName)

傳回包含來源集合中每個節點祖系的已篩選項目集合。Returns a filtered collection of elements that contains the ancestors of every node in the source collection. 集合中只會包含具有相符之 XName 的項目。Only elements that have a matching XName are included in the collection.

DescendantNodes<T>(IEnumerable<T>) DescendantNodes<T>(IEnumerable<T>) DescendantNodes<T>(IEnumerable<T>) DescendantNodes<T>(IEnumerable<T>)

傳回來源集合中每個文件和項目之子代節點的集合。Returns a collection of the descendant nodes of every document and element in the source collection.

Descendants<T>(IEnumerable<T>) Descendants<T>(IEnumerable<T>) Descendants<T>(IEnumerable<T>) Descendants<T>(IEnumerable<T>)

傳回包含來源集合中每個項目和文件之子代項目的項目集合。Returns a collection of elements that contains the descendant elements of every element and document in the source collection.

Descendants<T>(IEnumerable<T>, XName) Descendants<T>(IEnumerable<T>, XName) Descendants<T>(IEnumerable<T>, XName) Descendants<T>(IEnumerable<T>, XName)

傳回已篩選的項目集合,其中包含來源集合中每個項目和文件的子代項目。Returns a filtered collection of elements that contains the descendant elements of every element and document in the source collection. 集合中只會包含具有相符之 XName 的項目。Only elements that have a matching XName are included in the collection.

Elements<T>(IEnumerable<T>) Elements<T>(IEnumerable<T>) Elements<T>(IEnumerable<T>) Elements<T>(IEnumerable<T>)

傳回來源集合中每個項目和文件的子項目集合。Returns a collection of the child elements of every element and document in the source collection.

Elements<T>(IEnumerable<T>, XName) Elements<T>(IEnumerable<T>, XName) Elements<T>(IEnumerable<T>, XName) Elements<T>(IEnumerable<T>, XName)

傳回來源集合中每個項目和文件的已篩選子項目集合。Returns a filtered collection of the child elements of every element and document in the source collection. 集合中只會包含具有相符之 XName 的項目。Only elements that have a matching XName are included in the collection.

InDocumentOrder<T>(IEnumerable<T>) InDocumentOrder<T>(IEnumerable<T>) InDocumentOrder<T>(IEnumerable<T>) InDocumentOrder<T>(IEnumerable<T>)

傳回包含來源集合中所有節點的節點集合,依據文件順序來排序。Returns a collection of nodes that contains all nodes in the source collection, sorted in document order.

Nodes<T>(IEnumerable<T>) Nodes<T>(IEnumerable<T>) Nodes<T>(IEnumerable<T>) Nodes<T>(IEnumerable<T>)

傳回來源集合中每個文件和項目的子節點集合。Returns a collection of the child nodes of every document and element in the source collection.

Remove<T>(IEnumerable<T>) Remove<T>(IEnumerable<T>) Remove<T>(IEnumerable<T>) Remove<T>(IEnumerable<T>)

在來源集合中,從每一個節點的父節點移除這些節點。Removes every node in the source collection from its parent node.

適用於