Skip to content
DocsTry Aspire
DocsTry

SqliteResourceBuilderExtensions Methods

ClassMethods2 members
Provides extension methods for adding Sqlite resources to an application builder.
AddSqlite(IDistributedApplicationBuilder, string, string?, string?)Section titled AddSqlite(IDistributedApplicationBuilder, string, string?, string?)extensionIResourceBuilder<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)
{
// ...
}
}
builderIDistributedApplicationBuilderThe application builder.
namestringThe name of the resource.
databasePathstring?optionalThe optional path to the database file. If no path is provided the database is stored in a temporary location.
databaseFileNamestring?optionalThe 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?)extensionIResourceBuilder<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)
{
// ...
}
}
builderIResourceBuilder<SqliteResource>The resource builder.
configureContainerAction<IResourceBuilder<SqliteWebResource>>optionalCallback to configure SqliteWeb container resource.
containerNamestring?optionalThe optional name of the container.
IResourceBuilder<SqliteResource>A resource builder for the Sqlite resource.
This overload is not available in polyglot app hosts. Use SqliteResourceBuilderExtensions.WithSqliteWebForPolyglot instead.