AspireSqliteExtensions Methods
ClassMethods2 members
Provides extension methods for registering Sqlite-related services in an
Hosting.IHostApplicationBuilder . AddKeyedSqliteConnection(IHostApplicationBuilder, string, Action<SqliteConnectionSettings>) Section titled AddKeyedSqliteConnection(IHostApplicationBuilder, string, Action<SqliteConnectionSettings>)extension Registers
Sqlite.SqliteConnection as keyed scoped for the given name in the services provided by the builder. public static class AspireSqliteExtensions{ public static void AddKeyedSqliteConnection( this IHostApplicationBuilder builder, string name, Action<SqliteConnectionSettings>? 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<SqliteConnectionSettings> optionalAn optional method that can be used for customizing the SqliteConnectionSettings . It's invoked after the settings are read from the configuration.Exceptions
InvalidOperationExceptionIf required ConnectionString is not provided in configuration section.Remarks
Reads the configuration from "Aspire:Sqlite:Client" section.
AddSqliteConnection(IHostApplicationBuilder, string, Action<SqliteConnectionSettings>) Section titled AddSqliteConnection(IHostApplicationBuilder, string, Action<SqliteConnectionSettings>)extension Registers
Sqlite.SqliteConnection as scoped in the services provided by the builder. public static class AspireSqliteExtensions{ public static void AddSqliteConnection( this IHostApplicationBuilder builder, string name, Action<SqliteConnectionSettings>? 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<SqliteConnectionSettings> optionalAn optional method that can be used for customizing the SqliteConnectionSettings . It's invoked after the settings are read from the configuration.Exceptions
InvalidOperationExceptionIf required ConnectionString is not provided in configuration section.Remarks
Reads the configuration from "Aspire:Sqlite:Client" section.