共用方式為


MefInjection<TService,TInterface>.GetServiceAsync 方法

定義

以異步方式傳回擷取的服務。

public System.Threading.Tasks.Task<TInterface> GetServiceAsync();
member this.GetServiceAsync : unit -> System.Threading.Tasks.Task<'Interface>
Public Function GetServiceAsync () As Task(Of TInterface)

傳回

Task<TInterface>

服務的實例 TService

備註

這個方法的多個呼叫會傳回相同的 實例 TInterface

適用於