HostedFileClientExtensions.GetService<TService> Метод

Определение

Возвращает службу указанного типа из файлового клиента.

public static TService? GetService<TService>(this Microsoft.Extensions.AI.IHostedFileClient client, object? serviceKey = default);
static member GetService : Microsoft.Extensions.AI.IHostedFileClient * obj -> 'Service
<Extension()>
Public Function GetService(Of TService) (client As IHostedFileClient, Optional serviceKey As Object = Nothing) As TService

Параметры типа

TService

Тип извлекаемой службы.

Параметры

client
IHostedFileClient

Файловый клиент.

serviceKey
Object

Необязательный ключ, который можно использовать для идентификации целевой службы.

Возвращаемое значение

TService

Найденная служба или null , если она недоступна.

Исключения

client равно null.

Применяется к