CommunityToolkit.Aspire.Microsoft.EntityFrameworkCore.Sqlite
13.0.0-preview.1.251125-0314
Prefix Reserved
dotnet add package CommunityToolkit.Aspire.Microsoft.EntityFrameworkCore.Sqlite --version 13.0.0-preview.1.251125-0314
NuGet\Install-Package CommunityToolkit.Aspire.Microsoft.EntityFrameworkCore.Sqlite -Version 13.0.0-preview.1.251125-0314
<PackageReference Include="CommunityToolkit.Aspire.Microsoft.EntityFrameworkCore.Sqlite" Version="13.0.0-preview.1.251125-0314" />
<PackageVersion Include="CommunityToolkit.Aspire.Microsoft.EntityFrameworkCore.Sqlite" Version="13.0.0-preview.1.251125-0314" />
<PackageReference Include="CommunityToolkit.Aspire.Microsoft.EntityFrameworkCore.Sqlite" />
paket add CommunityToolkit.Aspire.Microsoft.EntityFrameworkCore.Sqlite --version 13.0.0-preview.1.251125-0314
#r "nuget: CommunityToolkit.Aspire.Microsoft.EntityFrameworkCore.Sqlite, 13.0.0-preview.1.251125-0314"
#:package CommunityToolkit.Aspire.Microsoft.EntityFrameworkCore.Sqlite@13.0.0-preview.1.251125-0314
#addin nuget:?package=CommunityToolkit.Aspire.Microsoft.EntityFrameworkCore.Sqlite&version=13.0.0-preview.1.251125-0314&prerelease
#tool nuget:?package=CommunityToolkit.Aspire.Microsoft.EntityFrameworkCore.Sqlite&version=13.0.0-preview.1.251125-0314&prerelease
CommunityToolkit.Aspire.Microsoft.EntityFrameworkCore.Sqlite library
Register a DbContext in the DI container to interact with a SQLite database using Entity Framework Core.
Getting Started
Prerequisites
- A
DbContext - A SQLite database
Install the package
Install the .NET Aspire EF Core Sqlite library using the following command:
dotnet add package CommunityToolkit.Aspire.Microsoft.EntityFrameworkCore.Sqlite
Example usage
Option 1: Using IHostApplicationBuilder (Traditional Aspire Pattern)
In the Program.cs file of your project, call the AddSqliteDbContext<TDbContext> extension method to register the TDbContext implementation in the DI container. This method takes the connection name as a parameter:
builder.AddSqliteDbContext<BloggingContext>("sqlite");
Option 2: Using WebApplicationBuilder (New Simplified Pattern)
For ASP.NET Core applications, you can use the simplified EnrichSqliteDatabaseDbContext<TDbContext> extension method:
// Basic usage with default connection string name "DefaultConnection"
builder.EnrichSqliteDatabaseDbContext<BloggingContext>();
// With custom connection string name
builder.EnrichSqliteDatabaseDbContext<BloggingContext>("MyConnection");
// Disable OpenTelemetry instrumentation
builder.EnrichSqliteDatabaseDbContext<BloggingContext>(enableOpenTelemetry: false);
The EnrichSqliteDatabaseDbContext method provides:
- Simplified API: Works directly with
WebApplicationBuilder - Default connection string: Uses "DefaultConnection" by default
- OpenTelemetry integration: Automatically adds EF Core instrumentation for distributed tracing
- Parameter validation: Proper error handling for missing connection strings
Then, in your service, inject TDbContext and use it to interact with the database:
public class MyService(BloggingContext context)
{
// ...
}
Additional documentation
- https://learn.microsoft.com/dotnet/aspire/community-toolkit/sqlite-entity-framework-integration
- https://learn.microsoft.com/ef/core/providers/sqlite/
Feedback & contributing
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Microsoft.EntityFrameworkCore.Sqlite (>= 9.0.9)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.0)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.0)
- Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore (>= 8.0.20)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.0)
- OpenTelemetry.Extensions.Hosting (>= 1.12.0)
- OpenTelemetry.Instrumentation.EntityFrameworkCore (>= 1.12.0-beta.2)
-
net8.0
- Microsoft.EntityFrameworkCore.Sqlite (>= 9.0.9)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.0)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.0)
- Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore (>= 8.0.20)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.0)
- OpenTelemetry.Extensions.Hosting (>= 1.12.0)
- OpenTelemetry.Instrumentation.EntityFrameworkCore (>= 1.12.0-beta.2)
-
net9.0
- Microsoft.EntityFrameworkCore.Sqlite (>= 9.0.9)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.0)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.0)
- Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore (>= 8.0.20)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.0)
- OpenTelemetry.Extensions.Hosting (>= 1.12.0)
- OpenTelemetry.Instrumentation.EntityFrameworkCore (>= 1.12.0-beta.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 13.0.0-preview.1.251125-0314 | 37 | 11/25/2025 |
| 13.0.0-beta.462 | 40 | 11/25/2025 |
| 13.0.0-beta.456 | 47 | 11/23/2025 |
| 13.0.0-beta.454 | 41 | 11/23/2025 |
| 13.0.0-beta.453 | 63 | 11/22/2025 |
| 13.0.0-beta.450 | 73 | 11/22/2025 |
| 13.0.0-beta.448 | 68 | 11/22/2025 |
| 13.0.0-beta.444 | 333 | 11/17/2025 |
| 13.0.0-beta.443 | 253 | 11/17/2025 |
| 13.0.0-beta.440 | 94 | 11/15/2025 |
| 13.0.0-beta.439 | 230 | 11/12/2025 |
| 13.0.0-beta.438 | 216 | 11/12/2025 |
| 13.0.0-beta.436 | 217 | 11/12/2025 |
| 13.0.0-beta.435 | 224 | 11/11/2025 |
| 13.0.0-beta.433 | 142 | 11/10/2025 |
| 13.0.0-beta.432 | 144 | 11/10/2025 |
| 13.0.0-beta.431 | 131 | 11/6/2025 |
| 13.0.0-beta.430 | 127 | 11/6/2025 |
| 9.9.0-preview.1.251103-2303 | 133 | 11/3/2025 |
| 9.9.0-beta.427 | 132 | 11/3/2025 |
| 9.8.1-beta.426 | 138 | 11/3/2025 |
| 9.8.1-beta.424 | 139 | 10/28/2025 |
| 9.8.1-beta.420 | 127 | 10/27/2025 |
| 9.8.1-beta.419 | 119 | 10/27/2025 |
| 9.8.1-beta.417 | 126 | 10/27/2025 |
| 9.8.1-beta.414 | 123 | 10/24/2025 |
| 9.8.1-beta.413 | 119 | 10/22/2025 |
| 9.8.1-beta.410 | 129 | 10/16/2025 |
| 9.8.1-beta.408 | 110 | 10/16/2025 |
| 9.8.1-beta.407 | 111 | 10/16/2025 |
| 9.8.1-beta.406 | 123 | 10/15/2025 |
| 9.8.0-preview.1.250926-0110 | 260 | 9/26/2025 |
| 9.8.0-beta.405 | 119 | 10/15/2025 |
| 9.8.0-beta.404 | 122 | 10/13/2025 |
| 9.8.0-beta.402 | 126 | 9/29/2025 |
| 9.8.0-beta.401 | 121 | 9/29/2025 |
| 9.8.0-beta.399 | 119 | 9/26/2025 |
| 9.8.0-beta.398 | 130 | 9/25/2025 |
| 9.8.0-beta.397 | 131 | 9/25/2025 |
| 9.8.0-beta.395 | 128 | 9/24/2025 |
| 9.8.0-beta.394 | 131 | 9/23/2025 |
| 9.8.0-beta.393 | 130 | 9/23/2025 |
| 9.8.0-beta.392 | 127 | 9/23/2025 |
| 9.8.0-beta.389 | 254 | 9/18/2025 |
| 9.8.0-beta.388 | 257 | 9/16/2025 |
| 9.8.0-beta.386 | 207 | 9/15/2025 |
| 9.8.0-beta.385 | 200 | 9/15/2025 |
| 9.8.0-beta.384 | 55 | 9/13/2025 |
| 9.8.0-beta.376 | 134 | 9/8/2025 |
| 9.8.0-beta.375 | 60 | 9/6/2025 |
| 9.8.0-beta.373 | 141 | 9/5/2025 |
| 9.8.0-beta.372 | 134 | 9/4/2025 |
| 9.8.0-beta.370 | 128 | 9/2/2025 |
| 9.8.0-beta.364 | 127 | 9/1/2025 |
| 9.7.2 | 3,117 | 8/29/2025 |
| 9.7.2-beta.362 | 169 | 8/29/2025 |
| 9.7.2-beta.361 | 177 | 8/29/2025 |
| 9.7.2-beta.360 | 172 | 8/29/2025 |
| 9.7.2-beta.359 | 171 | 8/28/2025 |
| 9.7.2-beta.358 | 169 | 8/28/2025 |
| 9.7.2-beta.357 | 171 | 8/28/2025 |
| 9.7.1 | 319 | 8/27/2025 |
| 9.7.1-beta.355 | 171 | 8/27/2025 |
| 9.7.1-beta.354 | 181 | 8/27/2025 |
| 9.7.1-beta.353 | 171 | 8/27/2025 |
| 9.7.1-beta.352 | 172 | 8/27/2025 |
| 9.7.1-beta.351 | 171 | 8/27/2025 |
| 9.7.1-beta.348 | 145 | 8/14/2025 |
| 9.7.1-beta.344 | 96 | 8/10/2025 |
| 9.7.1-beta.343 | 202 | 8/8/2025 |
| 9.7.1-beta.342 | 208 | 8/7/2025 |
| 9.7.1-beta.341 | 207 | 8/6/2025 |
| 9.7.1-beta.340 | 195 | 8/5/2025 |
| 9.7.1-beta.339 | 190 | 8/5/2025 |
| 9.7.0 | 604 | 8/1/2025 |
| 9.7.0-beta.337 | 87 | 8/1/2025 |
| 9.7.0-beta.336 | 99 | 8/1/2025 |
| 9.7.0-beta.335 | 98 | 8/1/2025 |
| 9.7.0-beta.333 | 105 | 7/30/2025 |
| 9.6.1-beta.332 | 107 | 7/30/2025 |
| 9.6.1-beta.331 | 102 | 7/30/2025 |
| 9.6.1-beta.330 | 105 | 7/30/2025 |
| 9.6.1-beta.329 | 103 | 7/30/2025 |
| 9.6.1-beta.328 | 114 | 7/29/2025 |
| 9.6.1-beta.327 | 120 | 7/28/2025 |
| 9.6.1-beta.326 | 120 | 7/28/2025 |
| 9.6.0 | 1,474 | 7/10/2025 |
| 9.6.0-beta.324 | 134 | 7/10/2025 |
| 9.5.1-beta.323 | 125 | 7/10/2025 |
| 9.5.1-beta.322 | 125 | 7/10/2025 |
| 9.5.1-beta.321 | 127 | 7/10/2025 |
| 9.5.1-beta.320 | 131 | 7/9/2025 |
| 9.5.1-beta.319 | 132 | 7/8/2025 |
| 9.5.1-beta.318 | 130 | 7/2/2025 |
| 9.5.1-beta.317 | 125 | 6/30/2025 |
| 9.5.1-beta.315 | 137 | 6/26/2025 |
| 9.5.1-beta.314 | 126 | 6/23/2025 |
| 9.5.1-beta.313 | 145 | 6/20/2025 |
| 9.5.1-beta.312 | 122 | 6/20/2025 |
| 9.5.1-beta.311 | 129 | 6/18/2025 |
| 9.5.1-beta.310 | 132 | 6/17/2025 |
| 9.5.1-beta.309 | 130 | 6/17/2025 |
| 9.5.1-beta.308 | 131 | 6/17/2025 |
| 9.5.1-beta.307 | 134 | 6/16/2025 |
| 9.5.1-beta.306 | 274 | 6/11/2025 |
| 9.5.1-beta.305 | 104 | 6/7/2025 |
| 9.5.1-beta.304 | 141 | 6/6/2025 |
| 9.5.1-beta.303 | 135 | 6/4/2025 |
| 9.5.1-beta.302 | 135 | 6/4/2025 |
| 9.5.1-beta.301 | 131 | 6/2/2025 |
| 9.5.1-beta.300 | 140 | 5/28/2025 |
| 9.5.0 | 1,084 | 5/27/2025 |
| 9.5.0-beta.299 | 132 | 5/27/2025 |
| 9.5.0-beta.298 | 139 | 5/26/2025 |
| 9.5.0-beta.297 | 116 | 5/24/2025 |
| 9.5.0-beta.296 | 83 | 5/24/2025 |
| 9.5.0-beta.295 | 82 | 5/24/2025 |
| 9.4.1-beta.291 | 133 | 5/19/2025 |
| 9.4.1-beta.289 | 145 | 5/16/2025 |
| 9.4.1-beta.288 | 197 | 5/16/2025 |
| 9.4.1-beta.287 | 215 | 5/16/2025 |
| 9.4.1-beta.286 | 215 | 5/16/2025 |
| 9.4.1-beta.285 | 220 | 5/14/2025 |
| 9.4.1-beta.284 | 246 | 5/13/2025 |
| 9.4.1-beta.283 | 216 | 5/12/2025 |
| 9.4.1-beta.282 | 160 | 5/7/2025 |
| 9.4.1-beta.280 | 129 | 5/2/2025 |
| 9.4.1-beta.279 | 161 | 5/2/2025 |
| 9.4.1-beta.277 | 524 | 4/23/2025 |
| 9.4.1-beta.276 | 150 | 4/23/2025 |
| 9.4.1-beta.275 | 146 | 4/23/2025 |
| 9.4.1-beta.274 | 164 | 4/23/2025 |
| 9.4.1-beta.273 | 155 | 4/23/2025 |
| 9.4.1-beta.272 | 172 | 4/23/2025 |
| 9.4.1-beta.271 | 139 | 4/23/2025 |
| 9.4.1-beta.270 | 161 | 4/20/2025 |
| 9.4.0 | 471 | 4/20/2025 |
| 9.4.0-beta.269 | 166 | 4/20/2025 |
| 9.4.0-beta.268 | 140 | 4/20/2025 |
| 9.3.1-beta.267 | 163 | 4/20/2025 |
| 9.3.1-beta.266 | 97 | 4/19/2025 |
| 9.3.1-beta.265 | 184 | 4/15/2025 |
| 9.3.1-beta.264 | 166 | 4/15/2025 |
| 9.3.1-beta.263 | 170 | 4/15/2025 |
| 9.3.1-beta.262 | 178 | 4/15/2025 |
| 9.3.1-beta.260 | 922 | 4/10/2025 |
| 9.3.1-beta.259 | 173 | 4/8/2025 |
| 9.3.1-beta.258 | 173 | 4/8/2025 |
| 9.3.1-beta.257 | 152 | 4/8/2025 |
| 9.3.1-beta.256 | 146 | 4/8/2025 |
| 9.3.1-beta.255 | 169 | 4/8/2025 |
| 9.3.1-beta.254 | 146 | 4/8/2025 |
| 9.3.1-beta.253 | 172 | 4/1/2025 |
| 9.3.1-beta.252 | 125 | 3/27/2025 |
| 9.3.1-beta.250 | 148 | 3/27/2025 |
| 9.3.1-beta.249 | 123 | 3/27/2025 |
| 9.3.1-beta.248 | 155 | 3/27/2025 |
| 9.3.1-beta.247 | 118 | 3/27/2025 |
| 9.3.1-beta.244 | 471 | 3/25/2025 |
| 9.3.1-beta.242 | 474 | 3/24/2025 |
| 9.3.1-beta.241 | 138 | 3/19/2025 |
| 9.3.0 | 1,074 | 3/19/2025 |
| 9.3.0-beta.239 | 132 | 3/19/2025 |
| 9.2.2-beta.237 | 136 | 3/19/2025 |
| 9.2.2-beta.236 | 272 | 3/14/2025 |
| 9.2.2-beta.230 | 180 | 3/13/2025 |
| 9.2.2-beta.229 | 139 | 3/13/2025 |
| 9.2.2-beta.228 | 153 | 3/11/2025 |
| 9.2.2-beta.227 | 180 | 3/11/2025 |
| 9.2.2-beta.226 | 151 | 3/11/2025 |
| 9.2.2-beta.225 | 158 | 3/11/2025 |
| 9.2.2-beta.224 | 170 | 3/11/2025 |
| 9.2.2-beta.223 | 174 | 3/10/2025 |
| 9.2.2-beta.222 | 154 | 3/10/2025 |
| 9.2.2-beta.220 | 155 | 3/9/2025 |
| 9.2.2-beta.218 | 146 | 3/9/2025 |
| 9.2.2-beta.217 | 193 | 3/7/2025 |
| 9.2.2-beta.216 | 203 | 3/7/2025 |
| 9.2.2-beta.215 | 218 | 3/7/2025 |
| 9.2.2-beta.214 | 224 | 3/5/2025 |
| 9.2.2-beta.213 | 198 | 3/5/2025 |
| 9.2.2-beta.212 | 183 | 3/5/2025 |
| 9.2.2-beta.211 | 188 | 3/4/2025 |
| 9.2.2-beta.210 | 195 | 3/4/2025 |
| 9.2.2-beta.208 | 101 | 3/3/2025 |
| 9.2.1 | 706 | 3/3/2025 |
| 9.2.1-beta.207 | 106 | 3/2/2025 |
| 9.2.1-beta.206 | 81 | 3/1/2025 |
| 9.2.1-beta.205 | 88 | 2/27/2025 |
| 9.2.1-beta.204 | 78 | 2/26/2025 |
| 9.2.1-beta.203 | 82 | 2/26/2025 |
| 9.2.0 | 693 | 2/26/2025 |
| 9.2.0-beta.202 | 68 | 2/26/2025 |
| 9.2.0-beta.201 | 101 | 2/26/2025 |
| 9.2.0-beta.199 | 75 | 2/26/2025 |
| 9.2.0-beta.198 | 70 | 2/26/2025 |
| 9.1.1-beta.197 | 87 | 2/25/2025 |
| 9.1.1-beta.196 | 78 | 2/25/2025 |
| 9.1.1-beta.195 | 72 | 2/25/2025 |
| 9.1.1-beta.194 | 77 | 2/25/2025 |
| 9.1.1-beta.193 | 78 | 2/25/2025 |
| 9.1.1-beta.192 | 117 | 2/24/2025 |
| 9.1.1-beta.191 | 112 | 2/24/2025 |
| 9.1.1-beta.190 | 79 | 2/19/2025 |
| 9.1.1-beta.189 | 84 | 2/19/2025 |
| 9.1.1-beta.188 | 104 | 2/19/2025 |
| 9.1.1-beta.187 | 122 | 2/19/2025 |
| 9.1.1-beta.183 | 89 | 2/18/2025 |
| 9.1.1-beta.182 | 86 | 2/18/2025 |
| 9.1.1-beta.181 | 93 | 2/18/2025 |
| 9.1.1-beta.180 | 89 | 2/17/2025 |
| 9.1.1-beta.178 | 83 | 2/17/2025 |
| 9.1.1-beta.177 | 88 | 2/12/2025 |
| 9.1.1-beta.176 | 123 | 2/11/2025 |
| 9.1.1-beta.175 | 93 | 2/11/2025 |
| 9.1.1-beta.173 | 86 | 2/10/2025 |
| 9.1.1-beta.169 | 84 | 2/6/2025 |
| 9.1.1-beta.168 | 76 | 2/5/2025 |
| 9.1.1-beta.166 | 85 | 2/5/2025 |
| 9.1.1-beta.165 | 102 | 2/5/2025 |
| 9.1.1-beta.164 | 118 | 2/3/2025 |
| 9.1.1-beta.162 | 109 | 2/3/2025 |
| 9.1.1-beta.155 | 90 | 1/30/2025 |
| 9.1.1-beta.154 | 80 | 1/30/2025 |
| 9.1.1-beta.153 | 71 | 1/30/2025 |
| 9.1.1-beta.152 | 72 | 1/29/2025 |
| 9.1.1-beta.150 | 106 | 1/29/2025 |
| 9.1.1-beta.148 | 77 | 1/26/2025 |
| 9.1.1-beta.147 | 85 | 1/26/2025 |
| 9.1.1-beta.146 | 85 | 1/23/2025 |
| 9.1.1-beta.145 | 96 | 1/22/2025 |
| 9.1.1-beta.144 | 96 | 1/22/2025 |
| 9.1.1-beta.142 | 83 | 1/22/2025 |
| 9.1.1-beta.140 | 97 | 1/22/2025 |
| 9.1.1-beta.139 | 77 | 1/21/2025 |
| 9.1.1-beta.138 | 94 | 1/20/2025 |
| 9.1.1-beta.137 | 100 | 1/17/2025 |
| 9.1.1-beta.136 | 75 | 1/15/2025 |
| 9.1.1-beta.135 | 50 | 1/15/2025 |