IDataServiceActionProvider.AdvertiseServiceAction 方法
判斷給定 [serviceAction] 是否應該通告為可繫結至給定 [resourceInstance]。
命名空間: System.Data.Services.Providers
組件: Microsoft.Data.Services (在 Microsoft.Data.Services.dll 中)
語法
'宣告
Function AdvertiseServiceAction ( _
operationContext As DataServiceOperationContext, _
serviceAction As ServiceAction, _
resourceInstance As Object, _
resourceInstanceInFeed As Boolean, _
ByRef actionToSerialize As ODataAction _
) As Boolean
'用途
Dim instance As IDataServiceActionProvider
Dim operationContext As DataServiceOperationContext
Dim serviceAction As ServiceAction
Dim resourceInstance As Object
Dim resourceInstanceInFeed As Boolean
Dim actionToSerialize As ODataAction
Dim returnValue As Boolean
returnValue = instance.AdvertiseServiceAction(operationContext, _
serviceAction, resourceInstance, _
resourceInstanceInFeed, actionToSerialize)
bool AdvertiseServiceAction(
DataServiceOperationContext operationContext,
ServiceAction serviceAction,
Object resourceInstance,
bool resourceInstanceInFeed,
ref ODataAction actionToSerialize
)
bool AdvertiseServiceAction(
DataServiceOperationContext^ operationContext,
ServiceAction^ serviceAction,
Object^ resourceInstance,
bool resourceInstanceInFeed,
ODataAction^% actionToSerialize
)
abstract AdvertiseServiceAction :
operationContext:DataServiceOperationContext *
serviceAction:ServiceAction *
resourceInstance:Object *
resourceInstanceInFeed:bool *
actionToSerialize:ODataAction byref -> bool
function AdvertiseServiceAction(
operationContext : DataServiceOperationContext,
serviceAction : ServiceAction,
resourceInstance : Object,
resourceInstanceInFeed : boolean,
actionToSerialize : ODataAction
) : boolean
參數
- operationContext
型別:System.Data.Services.DataServiceOperationContext
資料服務作業內容執行個體。
- serviceAction
型別:System.Data.Services.Providers.ServiceAction
要通告的服務動作。
- resourceInstance
型別:System.Object
服務動作所繫結之資源的執行個體。
- resourceInstanceInFeed
型別:System.Boolean
如果要序列化的資源執行個體位於摘要內,則為 true,否則為 false。true 的值表示序列化期間可能會多次呼叫這個方法,因為摘要內的每一個資源執行個體都會呼叫此方法一次。如果判斷是否要通告 [resourceInstance] 的服務動作是一個高成本的作業,提供者可能會選擇永遠都通告,好讓效能最佳化。
- actionToSerialize
型別:Microsoft.Data.OData.ODataAction%
要序列化的 ODataAction。伺服器會建構傳入此呼叫的版本,這可能會由這個介面的實作加以取代。這絕對不應該設定為 null,除非傳回 false。
傳回值
型別:System.Boolean
如果應該通告此服務動作,則為 true,否則為 false。