次の方法で共有


DataServiceCollection<T> コンストラクター (DataServiceContext)

指定した DataServiceContext を使用して、DataServiceCollection<T> クラスの新しいインスタンスを作成します。

名前空間:  System.Data.Services.Client
アセンブリ:  Microsoft.Data.Services.Client (Microsoft.Data.Services.Client.dll)

構文

'宣言
Public Sub New ( _
    context As DataServiceContext _
)
'使用
Dim context As DataServiceContext

Dim instance As New DataServiceCollection(context)
public DataServiceCollection(
    DataServiceContext context
)
public:
DataServiceCollection(
    DataServiceContext^ context
)
new : 
        context:DataServiceContext -> DataServiceCollection
public function DataServiceCollection(
    context : DataServiceContext
)

パラメーター

説明

このコンストラクターを使用して、サービスに対してクエリを実行しない場合または IEnumerable<T> が使用できない場合にエンティティ オブジェクトを追加できる空の DataServiceCollection<T> を作成します。

既定では、DataServiceCollection<T> に対して自動変更追跡が有効になっています。 TrackingModeNone の値を指定できるようにするコンストラクターを使用してインスタンスを作成するときに、手動変更追跡を使用する DataServiceCollection<T> のインスタンスを作成できます。 手動追跡を使用するときは、INotifyPropertyChanged および INotifyCollectionChanged を実装し、発生イベントを処理して、手動で変更を DataServiceContext に報告する必要があります。

関連項目

参照

DataServiceCollection<T> クラス

DataServiceCollection<T> オーバーロード

System.Data.Services.Client 名前空間