DataService<T> 類別

定義

開發 ADO.NET 資料服務的主要進入點 (Entry Point)。The main entry point for developing an ADO.NET Data Service.

generic <typename T>
public ref class DataService : System::Data::Services::IRequestHandler
[System.ServiceModel.Activation.AspNetCompatibilityRequirements(RequirementsMode=System.ServiceModel.Activation.AspNetCompatibilityRequirementsMode.Allowed)]
[System.ServiceModel.ServiceBehavior(InstanceContextMode=System.ServiceModel.InstanceContextMode.PerCall)]
public class DataService<T> : System.Data.Services.IRequestHandler
[<System.ServiceModel.Activation.AspNetCompatibilityRequirements(RequirementsMode=System.ServiceModel.Activation.AspNetCompatibilityRequirementsMode.Allowed)>]
[<System.ServiceModel.ServiceBehavior(InstanceContextMode=System.ServiceModel.InstanceContextMode.PerCall)>]
type DataService<'T> = class
    interface IRequestHandler
Public Class DataService(Of T)
Implements IRequestHandler

類型參數

T

定義資料服務的類型。Type that defines the data service.

繼承
DataService<T>
屬性
實作

備註

DataService<T> 類別會為伺服器系統的所有元件進行基本整合。The DataService<T> class does the basic integration of all components of the server system. 使用系統預設值進行授權和快取的新資料服務,是透過定義衍生自 DataService<T> 類別的類別,並透過參考相容的資料模型所建立。A new data service that uses system defaults for authorization and caching is created by defining a class that derives from the DataService<T> class and by referencing a compatible data model.

DataService<T> 的型別必須公開至少一個屬性,以傳回實體類型之 IQueryable<T> 集合的實體集。The type of the DataService<T> must expose at least one property that returns an entity set that is an IQueryable<T> collection of entity types. 此類別還必須實作 IUpdatable 介面,使實體資源進行更新。This class must also implement the IUpdatable interface to enable updates to be made to entity resources.

建構函式

DataService<T>()

建立新的資料服務,部署範本類別所表示的型別資料。Creates a new data service that deploys data of the type indicated by the template class.

屬性

CurrentDataSource

取得目前用來處理要求的資料來源執行個體。Gets the data source instance currently being used to process the request.

ProcessingPipeline

取得物件,用於定義資料服務處理管線的事件。Gets an object that defines the events for the data service processing pipeline.

方法

AttachHost(IDataServiceHost)

將資料服務主機附加到參數 host 所識別的資料服務。Attaches the data service host to the data service identified by the parameter host.

CreateDataSource()

建立資料服務所用之範本類別的資料來源。Creates a data source of the template class that will be used by the data service.

Equals(Object)

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

(繼承來源 Object)
GetHashCode()

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

(繼承來源 Object)
GetType()

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

(繼承來源 Object)
HandleException(HandleExceptionArgs)

在處理要求引發例外狀況時呼叫。Called when an exception is raised while processing a request.

MemberwiseClone()

建立目前 Object 的淺層複製。Creates a shallow copy of the current Object.

(繼承來源 Object)
OnStartProcessingRequest(ProcessRequestArgs)

在處理每個要求之前呼叫。Called before processing each request. 對於批次要求,針對最上層批次要求呼叫一次,並針對批次中每個作業呼叫一次。For batch requests, it is called one time for the top batch request and one time for each operation in the batch.

ProcessRequest()

處理 HTTP 要求。Processes an HTTP request.

ProcessRequestForMessage(Stream)

處理 HTTP 要求。Processes an HTTP request.

ToString()

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

(繼承來源 Object)

適用於