Share via


KeywordHybridSearchExtensions.GetRequiredService<TRecord> Method

Definition

Asks the IKeywordHybridSearchable<TRecord> for an object of the specified type serviceType and throw an exception if one isn't available.

public static object GetRequiredService<TRecord>(this Microsoft.Extensions.VectorData.IKeywordHybridSearchable<TRecord> keywordHybridSearch, Type serviceType, object? serviceKey = default);
static member GetRequiredService : Microsoft.Extensions.VectorData.IKeywordHybridSearchable<'Record> * Type * obj -> obj
<Extension()>
Public Function GetRequiredService(Of TRecord) (keywordHybridSearch As IKeywordHybridSearchable(Of TRecord), serviceType As Type, Optional serviceKey As Object = Nothing) As Object

Type Parameters

TRecord

The record data model to use for retrieving data from the store.

Parameters

keywordHybridSearch
IKeywordHybridSearchable<TRecord>

The keyword hybrid search.

serviceType
Type

The type of object being requested.

serviceKey
Object

An optional key that can be used to help identify the target service.

Returns

The found object.

Exceptions

serviceType is null.

No service of the requested type for the specified key is available.

Applies to