語言

TransactionHandlerResolver.GetService(Type, Object) 方法

定義

若給定型別為 Func<TResult>,則此方法將嘗試回傳 以使用服務,否則返回 null。 當給定型態為 Func<TResult>時,則鍵值預期為 ExecutionStrategyKey。

public object GetService(Type type, object key);
abstract member GetService : Type * obj -> obj
override this.GetService : Type * obj -> obj

參數

type
Type

要解決的服務類型。

key
Object

一把用來判斷服務是否要返回的鑰匙。

傳回

一個 Func<TResult>,或零點。

實作

適用於