SearchClientHostExtensions.AddSearchClient Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| AddSearchClient(IHostApplicationBuilder, String) |
Adds a singleton SearchClient to the IHostApplicationBuilder's service collection. |
| AddSearchClient(IHostApplicationBuilder, String, Action<SearchClientSettings>) |
Adds a singleton SearchClient to the IHostApplicationBuilder's service collection. |
AddSearchClient(IHostApplicationBuilder, String)
Adds a singleton SearchClient to the IHostApplicationBuilder's service collection.
public static System.ClientModel.Primitives.IClientBuilder AddSearchClient(this Microsoft.Extensions.Hosting.IHostApplicationBuilder host, string sectionName);
static member AddSearchClient : Microsoft.Extensions.Hosting.IHostApplicationBuilder * string -> System.ClientModel.Primitives.IClientBuilder
<Extension()>
Public Function AddSearchClient (host As IHostApplicationBuilder, sectionName As String) As IClientBuilder
Parameters
The IHostApplicationBuilder to add to.
- sectionName
- String
The section of IConfiguration to use.
Returns
An IClientBuilder that can be used to further configure the client.
Applies to
AddSearchClient(IHostApplicationBuilder, String, Action<SearchClientSettings>)
Adds a singleton SearchClient to the IHostApplicationBuilder's service collection.
public static System.ClientModel.Primitives.IClientBuilder AddSearchClient(this Microsoft.Extensions.Hosting.IHostApplicationBuilder host, string sectionName, Action<Azure.Search.Documents.SearchClientSettings> configureSettings);
static member AddSearchClient : Microsoft.Extensions.Hosting.IHostApplicationBuilder * string * Action<Azure.Search.Documents.SearchClientSettings> -> System.ClientModel.Primitives.IClientBuilder
<Extension()>
Public Function AddSearchClient (host As IHostApplicationBuilder, sectionName As String, configureSettings As Action(Of SearchClientSettings)) As IClientBuilder
Parameters
The IHostApplicationBuilder to add to.
- sectionName
- String
The section of IConfiguration to use.
- configureSettings
- Action<SearchClientSettings>
Factory method to modify the SearchClientSettings after they are created.
Returns
An IClientBuilder that can be used to further configure the client.