Skip to content
Docs Try Aspire

AspireSqliteExtensions Methods

Class Methods 2 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)
{
// ...
}
}
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<SqliteConnectionSettings> optional An optional method that can be used for customizing the SqliteConnectionSettings. 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: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)
{
// ...
}
}
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<SqliteConnectionSettings> optional An optional method that can be used for customizing the SqliteConnectionSettings. 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:Sqlite:Client" section.