Skip to content
Docs Try Aspire

AspireSurrealDbExtensions Methods

Class Methods 2 members
Provides extension methods for registering SurrealDB-related services in an Hosting.IHostApplicationBuilder.
AddKeyedSurrealClient(IHostApplicationBuilder, string, Action<SurrealDbClientSettings>) Section titled AddKeyedSurrealClient(IHostApplicationBuilder, string, Action<SurrealDbClientSettings>) extension
Registers Net.SurrealDbClient as a keyed service for the given name in the services provided by the builder.
public static class AspireSurrealDbExtensions
{
public static void AddKeyedSurrealClient(
this IHostApplicationBuilder builder,
string name,
Action<SurrealDbClientSettings>? configureSettings = null)
{
// ...
}
}
builder IHostApplicationBuilder The Hosting.IHostApplicationBuilder to read config from and add services to.
name string The connection name to use to find a connection string.
configureSettings Action<SurrealDbClientSettings> optional An optional method that can be used for customizing the SurrealDbClientSettings. It's invoked after the settings are read from the configuration.
InvalidOperationException If required ConnectionString is not provided in configuration section
Reads the configuration from "Aspire:Surreal:Client" section.
AddSurrealClient(IHostApplicationBuilder, string, Action<SurrealDbClientSettings>) Section titled AddSurrealClient(IHostApplicationBuilder, string, Action<SurrealDbClientSettings>) extension
Registers Net.SurrealDbClient in the services provided by the builder.
public static class AspireSurrealDbExtensions
{
public static void AddSurrealClient(
this IHostApplicationBuilder builder,
string connectionName,
Action<SurrealDbClientSettings>? configureSettings = null)
{
// ...
}
}
builder IHostApplicationBuilder The Hosting.IHostApplicationBuilder to read config from and add services to.
connectionName string The connection name to use to find a connection string.
configureSettings Action<SurrealDbClientSettings> optional An optional method that can be used for customizing the SurrealDbClientSettings. It's invoked after the settings are read from the configuration.
InvalidOperationException If required ConnectionString is not provided in configuration section
Reads the configuration from "Aspire:Surreal:Client" section.