An Aspire client integration for the Microsoft.Data.Sqlite.Core package.
Install
| Product | Versions |
|---|---|
| .NET |
README
CommunityToolkit.Aspire.Microsoft.Data.Sqlite library
Register a SqliteConnection in the DI container to interact with a SQLite database using ADO.NET.
Getting Started
Prerequisites
- A SQLite database
Install the package
Install the .NET Aspire EF Core Sqlite library using the following command:
dotnet add package CommunityToolkit.Aspire.Microsoft.Data.Sqlite
Example usage
In the Program.cs file of your project, call the AddSqliteConnection extension method to register the SqliteConnection implementation in the DI container. This method takes the connection name as a parameter:
builder.AddSqliteConnection("sqlite");
Then, in your service, inject SqliteConnection and use it to interact with the database:
public class MyService(SqliteConnection context)
{
// ...
}
Additional documentation
- https://learn.microsoft.com/dotnet/aspire/community-toolkit/sqlite
- https://learn.microsoft.com/dotnet/standard/data/sqlite
Feedback & contributing
Changes from Previous Version
Adoption Assessment
A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.
Related Guides & Workflows
Learn how to evaluate, integrate, or audit this package in your .NET project.