AspireSurrealDbExtensions Methods
ClassMethods2 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) { // ... }}Parameters
builderIHostApplicationBuilder The Hosting.IHostApplicationBuilder to read config from and add services to.namestringThe connection name to use to find a connection string.configureSettings Action<SurrealDbClientSettings> optionalAn optional method that can be used for customizing the SurrealDbClientSettings . It's invoked after the settings are read from the configuration.Exceptions
InvalidOperationExceptionIf required ConnectionString is not provided in configuration sectionRemarks
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) { // ... }}Parameters
builderIHostApplicationBuilder The Hosting.IHostApplicationBuilder to read config from and add services to.connectionName stringThe connection name to use to find a connection string.configureSettings Action<SurrealDbClientSettings> optionalAn optional method that can be used for customizing the SurrealDbClientSettings . It's invoked after the settings are read from the configuration.Exceptions
InvalidOperationExceptionIf required ConnectionString is not provided in configuration sectionRemarks
Reads the configuration from "Aspire:Surreal:Client" section.