Skip to content
DocsTry Aspire
DocsTry

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)
{
// ...
}
}
builderIHostApplicationBuilderThe Hosting.IHostApplicationBuilder to read config from and add services to.
namestringThe connection name to use to find a connection string.
configureSettingsAction<SqliteConnectionSettings>optionalAn optional method that can be used for customizing the SqliteConnectionSettings. It's invoked after the settings are read from the configuration.
InvalidOperationExceptionIf 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)
{
// ...
}
}
builderIHostApplicationBuilderThe Hosting.IHostApplicationBuilder to read config from and add services to.
namestringThe connection name to use to find a connection string.
configureSettingsAction<SqliteConnectionSettings>optionalAn optional method that can be used for customizing the SqliteConnectionSettings. It's invoked after the settings are read from the configuration.
InvalidOperationExceptionIf required ConnectionString is not provided in configuration section.
Reads the configuration from "Aspire:Sqlite:Client" section.