IDispatchOperationSelector 介面

定義

定義合約,這個合約會使傳入訊息與本機作業產生關聯,以便自訂服務執行行為。

public interface class IDispatchOperationSelector
public interface IDispatchOperationSelector
type IDispatchOperationSelector = interface
Public Interface IDispatchOperationSelector
衍生

範例

public class QueryStringDispatcherBehavior : IDispatchOperationSelector  
{  
//Define the mapping from the Actions of the message to the operations.  
NameValueCollection actionMap; { … }  

//Implement the SelectOperation method.  
public string SelectOperation( ref Message message )  
        {  
            Uri uri = new Uri(message.Headers.Action);  
            string query = uri.Query;  

            string methodName = actionMap[message.Headers.Action.ToString()];  

            return methodName;  
        }  
}  

備註

實作和插入自訂作業選取器來自訂作業選取,而該作業目的是將傳入訊息分派到服務應用程式。 將 IDispatchOperationSelector 物件指派給 OperationSelector 屬性,便可插入自訂選取器。

方法

SelectOperation(Message)

使本機作業與傳入方法產生關聯。

適用於