共用方式為


GlobalBrokeredServiceContainer.View.GetProxyAsync<T> 方法

定義

要求透過用戶端 Proxy 存取某些服務。

public virtual System.Threading.Tasks.ValueTask<T?> GetProxyAsync<T> (Microsoft.ServiceHub.Framework.ServiceRpcDescriptor serviceDescriptor, Microsoft.ServiceHub.Framework.ServiceActivationOptions options, System.Threading.CancellationToken cancellationToken) where T : class;
abstract member GetProxyAsync : Microsoft.ServiceHub.Framework.ServiceRpcDescriptor * Microsoft.ServiceHub.Framework.ServiceActivationOptions * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<'T (requires 'T : null)> (requires 'T : null)
override this.GetProxyAsync : Microsoft.ServiceHub.Framework.ServiceRpcDescriptor * Microsoft.ServiceHub.Framework.ServiceActivationOptions * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<'T (requires 'T : null)> (requires 'T : null)
Public Overridable Function GetProxyAsync(Of T As Class) (serviceDescriptor As ServiceRpcDescriptor, options As ServiceActivationOptions, cancellationToken As CancellationToken) As ValueTask(Of T)

類型參數

T

要建立的用戶端 Proxy 類型。

參數

serviceDescriptor
ServiceRpcDescriptor

服務的描述項。

options
ServiceActivationOptions

改變服務啟用方式的其他選項,或將其他數據提供給服務建構函式。

cancellationToken
CancellationToken

取消語彙基元。

傳回

可用來與服務通訊的用戶端 Proxy;如果 null 找不到相符的服務,則為 。 如果傳回的 實例實 IDisposable作 ,就應該再不需要時處置此專案。

實作

適用於