RelatedEnd.Merge<TEntity>(IEnumerable<TEntity>, MergeOption, Boolean) 方法

定義

將相關實體合併至本機 EntityCollection<TEntity> 中。Merges related entities into the local EntityCollection<TEntity>.

protected:
generic <typename TEntity>
 void Merge(System::Collections::Generic::IEnumerable<TEntity> ^ collection, System::Data::Objects::MergeOption mergeOption, bool setIsLoaded);
protected void Merge<TEntity> (System.Collections.Generic.IEnumerable<TEntity> collection, System.Data.Objects.MergeOption mergeOption, bool setIsLoaded);
member this.Merge : seq<'Entity> * System.Data.Objects.MergeOption * bool -> unit
Protected Sub Merge(Of TEntity) (collection As IEnumerable(Of TEntity), mergeOption As MergeOption, setIsLoaded As Boolean)

類型參數

TEntity

要合併之實體物件的 IEnumerable<T> 集合類型。The type of the IEnumerable<T> collection of entity objects to be merged.

參數

collection
IEnumerable<TEntity>

要加入至這個相關端之實體物件的 IEnumerable<T> 集合。An IEnumerable<T> collection of entity objects to add to this related end.

mergeOption
MergeOption

將物件合併至現有的 MergeOption 時要使用的 EntityCollection<TEntity>The MergeOption to use when merging objects into an existing EntityCollection<TEntity>.

setIsLoaded
Boolean

指出相關物件的集合是否完整而且與伺服器相符。Indicates whether the set of related objects is complete and matches the server. Load(MergeOption) 等作業會將 setIsLoaded 設定為 true,但 Attach 會將它設為 falseOperations such as Load(MergeOption) set setIsLoaded to true, but Attach sets it to false.

備註

在關聯性作業期間,物件服務會呼叫 Merge<TEntity> 方法。The Merge<TEntity> method is called by Object Services during relationship operations.

適用於