Share via


DataServiceCollection<T>.Load Method

Definition

Overloads

Load(IEnumerable<T>)

Loads a collection of entity objects into the collection.

Load(T)

Loads a single entity object into the collection.

Load(IEnumerable<T>)

Loads a collection of entity objects into the collection.

public void Load (System.Collections.Generic.IEnumerable<T> items);
member this.Load : seq<'T> -> unit
Public Sub Load (items As IEnumerable(Of T))

Parameters

items
IEnumerable<T>

Collection of entity objects to be added to the DataServiceCollection<T>.

Remarks

When tracking is enabled, the behavior of Load would be to attach all those entities that are not already tracked by the context associated with the collection. The operation will go deep into the input entities so that all related entities are attached to the context if not already present. All entities in items will be tracked after Load is done. Load method checks for duplication. The collection will ignore any duplicated items been loaded. For large amount of items, consider DataServiceContext.LoadProperty instead.

Applies to

Load(T)

Loads a single entity object into the collection.

public void Load (T item);
member this.Load : 'T -> unit
Public Sub Load (item As T)

Parameters

item
T

Entity object to be added.

Remarks

When tracking is enabled, the behavior of Load would be to attach the entity if it is not already tracked by the context associated with the collection. The operation will go deep into the input entity so that all related entities are attached to the context if not already present. The item will be tracked after Load is done. Load method checks for duplication. The collection will ignore any duplicated items been loaded.

Applies to