Skip to content
Docs Try Aspire

SqliteResourceBuilderExtensions Methods

Class Methods 2 members
Provides extension methods for adding Sqlite resources to an application builder.
AddSqlite(IDistributedApplicationBuilder, string, string?, string?) Section titled AddSqlite(IDistributedApplicationBuilder, string, string?, string?) extension IResourceBuilder<SqliteResource>
Adds an Sqlite resource to the application builder.
public static class SqliteResourceBuilderExtensions
{
public static IResourceBuilder<SqliteResource> AddSqlite(
this IDistributedApplicationBuilder builder,
string name,
string? databasePath = null,
string? databaseFileName = null)
{
// ...
}
}
builder IDistributedApplicationBuilder The application builder.
name string The name of the resource.
databasePath string? optional The optional path to the database file. If no path is provided the database is stored in a temporary location.
databaseFileName string? optional The filename of the database file. Must include extension. If no file name is provided, a randomly generated file name is used.
IResourceBuilder<SqliteResource> A resource builder for the Sqlite resource.
WithSqliteWeb(IResourceBuilder<SqliteResource>, Action<IResourceBuilder<SqliteWebResource>>, string?) Section titled WithSqliteWeb(IResourceBuilder<SqliteResource>, Action<IResourceBuilder<SqliteWebResource>>, string?) extension IResourceBuilder<SqliteResource>
Adds an Sqlite Web resource to the resource builder, to allow access to the Sqlite database via a web interface.
public static class SqliteResourceBuilderExtensions
{
public static IResourceBuilder<SqliteResource> WithSqliteWeb(
this IResourceBuilder<SqliteResource> builder,
Action<IResourceBuilder<SqliteWebResource>>? configureContainer = null,
string? containerName = null)
{
// ...
}
}
builder IResourceBuilder<SqliteResource> The resource builder.
configureContainer Action<IResourceBuilder<SqliteWebResource>> optional Callback to configure SqliteWeb container resource.
containerName string? optional The optional name of the container.
IResourceBuilder<SqliteResource> A resource builder for the Sqlite resource.