共用方式為


AspireMilvusExtensions.AddMilvusClient Method

Definition

Registers Milvus.Client.MilvusClient as a singleton in the services provided by the builder. Configures logging for the Milvus.Client.MilvusClient.

public static void AddMilvusClient (this Microsoft.Extensions.Hosting.IHostApplicationBuilder builder, string connectionName, Action<Aspire.Milvus.Client.MilvusClientSettings>? configureSettings = default);
static member AddMilvusClient : Microsoft.Extensions.Hosting.IHostApplicationBuilder * string * Action<Aspire.Milvus.Client.MilvusClientSettings> -> unit
<Extension()>
Public Sub AddMilvusClient (builder As IHostApplicationBuilder, connectionName As String, Optional configureSettings As Action(Of MilvusClientSettings) = Nothing)

Parameters

builder
IHostApplicationBuilder

The IHostApplicationBuilder to read config from and add services to.

connectionName
String

The connection name to use to find a connection string.

configureSettings
Action<MilvusClientSettings>

An optional method that can be used for customizing the MilvusClientSettings. It's invoked after the settings are read from the configuration.

Exceptions

If required ConnectionString is not provided in configuration section

Remarks

Reads the configuration from "Aspire:Milvus:Client" section.

Applies to