Share via


DataServiceCollection<T> Constructors

Definition

Overloads

DataServiceCollection<T>()

Initializes a new instance of the DataServiceCollection<T> class.

DataServiceCollection<T>(DataServiceContext)

Initializes a new instance of the DataServiceCollection<T> class that uses the specified DataServiceContext.

DataServiceCollection<T>(DataServiceQuerySingle<T>)

Initializes a new instance of the DataServiceCollection<T> class based on query execution.

DataServiceCollection<T>(IEnumerable<T>)

Initializes a new instance of the DataServiceCollection<T> class based on query execution.

DataServiceCollection<T>(TrackingMode, DataServiceQuerySingle<T>)

Initializes a new instance of the DataServiceCollection<T> class based on query execution and with the specified tracking mode.

DataServiceCollection<T>(IEnumerable<T>, TrackingMode)

Initializes a new instance of the DataServiceCollection<T> class based on query execution and with the specified tracking mode.

DataServiceCollection<T>(DataServiceContext, String, Func<EntityChangedParams,Boolean>, Func<EntityCollectionChangedParams,Boolean>)

Initializes a new instance of the DataServiceCollection<T> class with the supplied change method delegates and that uses the specified DataServiceContext.

DataServiceCollection<T>(IEnumerable<T>, TrackingMode, String, Func<EntityChangedParams,Boolean>, Func<EntityCollectionChangedParams,Boolean>)

Initializes a new instance of the DataServiceCollection<T> class based on query execution and with the supplied change method delegates.

DataServiceCollection<T>(DataServiceContext, IEnumerable<T>, TrackingMode, String, Func<EntityChangedParams,Boolean>, Func<EntityCollectionChangedParams, Boolean>)

Initializes a new instance of the DataServiceCollection<T> class based on query execution, with the supplied change method delegates, and that uses the supplied DataServiceContext.

DataServiceCollection<T>()

Initializes a new instance of the DataServiceCollection<T> class.

public DataServiceCollection ();
Public Sub New ()

Remarks

Creates a default data service collection, with auto-change tracking enabled as soon as data is loaded into it.

Applies to

DataServiceCollection<T>(DataServiceContext)

Initializes a new instance of the DataServiceCollection<T> class that uses the specified DataServiceContext.

public DataServiceCollection (Microsoft.OData.Client.DataServiceContext context);
new Microsoft.OData.Client.DataServiceCollection<'T> : Microsoft.OData.Client.DataServiceContext -> Microsoft.OData.Client.DataServiceCollection<'T>
Public Sub New (context As DataServiceContext)

Parameters

context
DataServiceContext

The DataServiceContext used to track changes to objects in the collection.

Applies to

DataServiceCollection<T>(DataServiceQuerySingle<T>)

Initializes a new instance of the DataServiceCollection<T> class based on query execution.

public DataServiceCollection (Microsoft.OData.Client.DataServiceQuerySingle<T> item);
new Microsoft.OData.Client.DataServiceCollection<'T> : Microsoft.OData.Client.DataServiceQuerySingle<'T> -> Microsoft.OData.Client.DataServiceCollection<'T>
Public Sub New (item As DataServiceQuerySingle(Of T))

Parameters

item
DataServiceQuerySingle<T>

A DataServiceQuerySingle<TElement> or LINQ query that returns an object that are used to initialize the collection.

Applies to

DataServiceCollection<T>(IEnumerable<T>)

Initializes a new instance of the DataServiceCollection<T> class based on query execution.

public DataServiceCollection (System.Collections.Generic.IEnumerable<T> items);
new Microsoft.OData.Client.DataServiceCollection<'T> : seq<'T> -> Microsoft.OData.Client.DataServiceCollection<'T>
Public Sub New (items As IEnumerable(Of T))

Parameters

items
IEnumerable<T>

A DataServiceQuery<TElement> or LINQ query that returns an IEnumerable<T> collection of objects that are used to initialize the collection.

Applies to

DataServiceCollection<T>(TrackingMode, DataServiceQuerySingle<T>)

Initializes a new instance of the DataServiceCollection<T> class based on query execution and with the specified tracking mode.

public DataServiceCollection (Microsoft.OData.Client.TrackingMode trackingMode, Microsoft.OData.Client.DataServiceQuerySingle<T> item);
new Microsoft.OData.Client.DataServiceCollection<'T> : Microsoft.OData.Client.TrackingMode * Microsoft.OData.Client.DataServiceQuerySingle<'T> -> Microsoft.OData.Client.DataServiceCollection<'T>
Public Sub New (trackingMode As TrackingMode, item As DataServiceQuerySingle(Of T))

Parameters

trackingMode
TrackingMode

A TrackingMode value that indicated whether or not changes made to items in the collection are automatically tracked.

item
DataServiceQuerySingle<T>

A DataServiceQuerySingle<TElement> or LINQ query that returns an object that are used to initialize the collection.

Applies to

DataServiceCollection<T>(IEnumerable<T>, TrackingMode)

Initializes a new instance of the DataServiceCollection<T> class based on query execution and with the specified tracking mode.

public DataServiceCollection (System.Collections.Generic.IEnumerable<T> items, Microsoft.OData.Client.TrackingMode trackingMode);
new Microsoft.OData.Client.DataServiceCollection<'T> : seq<'T> * Microsoft.OData.Client.TrackingMode -> Microsoft.OData.Client.DataServiceCollection<'T>
Public Sub New (items As IEnumerable(Of T), trackingMode As TrackingMode)

Parameters

items
IEnumerable<T>

A DataServiceQuery<TElement> or LINQ query that returns an IEnumerable<T> collection of objects that are used to initialize the collection.

trackingMode
TrackingMode

A TrackingMode value that indicated whether or not changes made to items in the collection are automatically tracked.

Applies to

DataServiceCollection<T>(DataServiceContext, String, Func<EntityChangedParams,Boolean>, Func<EntityCollectionChangedParams,Boolean>)

Initializes a new instance of the DataServiceCollection<T> class with the supplied change method delegates and that uses the specified DataServiceContext.

public DataServiceCollection (Microsoft.OData.Client.DataServiceContext context, string entitySetName, Func<Microsoft.OData.Client.EntityChangedParams,bool> entityChangedCallback, Func<Microsoft.OData.Client.EntityCollectionChangedParams,bool> collectionChangedCallback);
new Microsoft.OData.Client.DataServiceCollection<'T> : Microsoft.OData.Client.DataServiceContext * string * Func<Microsoft.OData.Client.EntityChangedParams, bool> * Func<Microsoft.OData.Client.EntityCollectionChangedParams, bool> -> Microsoft.OData.Client.DataServiceCollection<'T>
Public Sub New (context As DataServiceContext, entitySetName As String, entityChangedCallback As Func(Of EntityChangedParams, Boolean), collectionChangedCallback As Func(Of EntityCollectionChangedParams, Boolean))

Parameters

context
DataServiceContext

The DataServiceContext used to track items in the collection.

entitySetName
String

The entity set of the objects in the collection.

entityChangedCallback
Func<EntityChangedParams,Boolean>

A delegate that encapsulates a method that is called when an entity changes.

collectionChangedCallback
Func<EntityCollectionChangedParams,Boolean>

A delegate that encapsulates a method that is called when the collection of entities changes.

Applies to

DataServiceCollection<T>(IEnumerable<T>, TrackingMode, String, Func<EntityChangedParams,Boolean>, Func<EntityCollectionChangedParams,Boolean>)

Initializes a new instance of the DataServiceCollection<T> class based on query execution and with the supplied change method delegates.

public DataServiceCollection (System.Collections.Generic.IEnumerable<T> items, Microsoft.OData.Client.TrackingMode trackingMode, string entitySetName, Func<Microsoft.OData.Client.EntityChangedParams,bool> entityChangedCallback, Func<Microsoft.OData.Client.EntityCollectionChangedParams,bool> collectionChangedCallback);
new Microsoft.OData.Client.DataServiceCollection<'T> : seq<'T> * Microsoft.OData.Client.TrackingMode * string * Func<Microsoft.OData.Client.EntityChangedParams, bool> * Func<Microsoft.OData.Client.EntityCollectionChangedParams, bool> -> Microsoft.OData.Client.DataServiceCollection<'T>
Public Sub New (items As IEnumerable(Of T), trackingMode As TrackingMode, entitySetName As String, entityChangedCallback As Func(Of EntityChangedParams, Boolean), collectionChangedCallback As Func(Of EntityCollectionChangedParams, Boolean))

Parameters

items
IEnumerable<T>

A DataServiceQuery<TElement> or LINQ query that returns an IEnumerable<T> collection of objects that are used to initialize the collection.

trackingMode
TrackingMode

A TrackingMode value that indicated whether or not changes made to items in the collection are automatically tracked.

entitySetName
String

The entity set of the objects in the collection.

entityChangedCallback
Func<EntityChangedParams,Boolean>

A delegate that encapsulates a method that is called when an entity changes.

collectionChangedCallback
Func<EntityCollectionChangedParams,Boolean>

A delegate that encapsulates a method that is called when the collection of entities changes.

Applies to

DataServiceCollection<T>(DataServiceContext, IEnumerable<T>, TrackingMode, String, Func<EntityChangedParams,Boolean>, Func<EntityCollectionChangedParams, Boolean>)

Initializes a new instance of the DataServiceCollection<T> class based on query execution, with the supplied change method delegates, and that uses the supplied DataServiceContext.

public DataServiceCollection (Microsoft.OData.Client.DataServiceContext context, System.Collections.Generic.IEnumerable<T> items, Microsoft.OData.Client.TrackingMode trackingMode, string entitySetName, Func<Microsoft.OData.Client.EntityChangedParams,bool> entityChangedCallback, Func<Microsoft.OData.Client.EntityCollectionChangedParams,bool> collectionChangedCallback);
new Microsoft.OData.Client.DataServiceCollection<'T> : Microsoft.OData.Client.DataServiceContext * seq<'T> * Microsoft.OData.Client.TrackingMode * string * Func<Microsoft.OData.Client.EntityChangedParams, bool> * Func<Microsoft.OData.Client.EntityCollectionChangedParams, bool> -> Microsoft.OData.Client.DataServiceCollection<'T>
Public Sub New (context As DataServiceContext, items As IEnumerable(Of T), trackingMode As TrackingMode, entitySetName As String, entityChangedCallback As Func(Of EntityChangedParams, Boolean), collectionChangedCallback As Func(Of EntityCollectionChangedParams, Boolean))

Parameters

context
DataServiceContext

The DataServiceContext used to track items in the collection.

items
IEnumerable<T>

A DataServiceQuery<TElement> or LINQ query that returns an IEnumerable<T> collection of objects that are used to initialize the collection.

trackingMode
TrackingMode

A TrackingMode value that indicated whether or not changes made to items in the collection are automatically tracked.

entitySetName
String

The entity set of the objects in the collection.

entityChangedCallback
Func<EntityChangedParams,Boolean>

A delegate that encapsulates a method that is called when an entity changes.

collectionChangedCallback
Func<EntityCollectionChangedParams,Boolean>

A delegate that encapsulates a method that is called when the collection of entities changes.

Applies to