CommunityToolkit.Aspire.Microsoft.EntityFrameworkCore.Sqlite 9.9.0-beta.427

Prefix Reserved
This is a prerelease version of CommunityToolkit.Aspire.Microsoft.EntityFrameworkCore.Sqlite.
dotnet add package CommunityToolkit.Aspire.Microsoft.EntityFrameworkCore.Sqlite --version 9.9.0-beta.427
                    
NuGet\Install-Package CommunityToolkit.Aspire.Microsoft.EntityFrameworkCore.Sqlite -Version 9.9.0-beta.427
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CommunityToolkit.Aspire.Microsoft.EntityFrameworkCore.Sqlite" Version="9.9.0-beta.427" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CommunityToolkit.Aspire.Microsoft.EntityFrameworkCore.Sqlite" Version="9.9.0-beta.427" />
                    
Directory.Packages.props
<PackageReference Include="CommunityToolkit.Aspire.Microsoft.EntityFrameworkCore.Sqlite" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add CommunityToolkit.Aspire.Microsoft.EntityFrameworkCore.Sqlite --version 9.9.0-beta.427
                    
#r "nuget: CommunityToolkit.Aspire.Microsoft.EntityFrameworkCore.Sqlite, 9.9.0-beta.427"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package CommunityToolkit.Aspire.Microsoft.EntityFrameworkCore.Sqlite@9.9.0-beta.427
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=CommunityToolkit.Aspire.Microsoft.EntityFrameworkCore.Sqlite&version=9.9.0-beta.427&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=CommunityToolkit.Aspire.Microsoft.EntityFrameworkCore.Sqlite&version=9.9.0-beta.427&prerelease
                    
Install as a Cake Tool

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

Feedback & contributing

https://github.com/CommunityToolkit/Aspire

Product 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 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
9.9.0-beta.427 23 11/3/2025
9.8.1-beta.426 33 11/3/2025
9.8.1-beta.424 128 10/28/2025
9.8.1-beta.420 122 10/27/2025
9.8.1-beta.419 113 10/27/2025
9.8.1-beta.417 120 10/27/2025
9.8.1-beta.414 116 10/24/2025
9.8.1-beta.413 115 10/22/2025
9.8.1-beta.410 126 10/16/2025
9.8.1-beta.408 107 10/16/2025
9.8.1-beta.407 108 10/16/2025
9.8.1-beta.406 120 10/15/2025
9.8.0-preview.1.250926-0110 184 9/26/2025
9.8.0-beta.405 116 10/15/2025
9.8.0-beta.404 119 10/13/2025
9.8.0-beta.402 123 9/29/2025
9.8.0-beta.401 118 9/29/2025
9.8.0-beta.399 116 9/26/2025
9.8.0-beta.398 128 9/25/2025
9.8.0-beta.397 129 9/25/2025
9.8.0-beta.395 125 9/24/2025
9.8.0-beta.394 128 9/23/2025
9.8.0-beta.393 127 9/23/2025
9.8.0-beta.392 125 9/23/2025
9.8.0-beta.389 252 9/18/2025
9.8.0-beta.388 255 9/16/2025
9.8.0-beta.386 205 9/15/2025
9.8.0-beta.385 197 9/15/2025
9.8.0-beta.384 53 9/13/2025
9.8.0-beta.376 129 9/8/2025
9.8.0-beta.375 57 9/6/2025
9.8.0-beta.373 139 9/5/2025
9.8.0-beta.372 131 9/4/2025
9.8.0-beta.370 126 9/2/2025
9.8.0-beta.364 124 9/1/2025
9.7.2 2,273 8/29/2025
9.7.2-beta.362 167 8/29/2025
9.7.2-beta.361 175 8/29/2025
9.7.2-beta.360 169 8/29/2025
9.7.2-beta.359 169 8/28/2025
9.7.2-beta.358 166 8/28/2025
9.7.2-beta.357 168 8/28/2025
9.7.1 316 8/27/2025
9.7.1-beta.355 168 8/27/2025
9.7.1-beta.354 179 8/27/2025
9.7.1-beta.353 168 8/27/2025
9.7.1-beta.352 169 8/27/2025
9.7.1-beta.351 168 8/27/2025
9.7.1-beta.348 140 8/14/2025
9.7.1-beta.344 94 8/10/2025
9.7.1-beta.343 200 8/8/2025
9.7.1-beta.342 205 8/7/2025
9.7.1-beta.341 203 8/6/2025
9.7.1-beta.340 193 8/5/2025
9.7.1-beta.339 188 8/5/2025
9.7.0 590 8/1/2025
9.7.0-beta.337 84 8/1/2025
9.7.0-beta.336 97 8/1/2025
9.7.0-beta.335 95 8/1/2025
9.7.0-beta.333 102 7/30/2025
9.6.1-beta.332 104 7/30/2025
9.6.1-beta.331 99 7/30/2025
9.6.1-beta.330 103 7/30/2025
9.6.1-beta.329 100 7/30/2025
9.6.1-beta.328 112 7/29/2025
9.6.1-beta.327 117 7/28/2025
9.6.1-beta.326 118 7/28/2025
9.6.0 1,448 7/10/2025
9.6.0-beta.324 132 7/10/2025
9.5.1-beta.323 123 7/10/2025
9.5.1-beta.322 123 7/10/2025
9.5.1-beta.321 125 7/10/2025
9.5.1-beta.320 129 7/9/2025
9.5.1-beta.319 130 7/8/2025
9.5.1-beta.318 128 7/2/2025
9.5.1-beta.317 123 6/30/2025
9.5.1-beta.315 135 6/26/2025
9.5.1-beta.314 124 6/23/2025
9.5.1-beta.313 136 6/20/2025
9.5.1-beta.312 120 6/20/2025
9.5.1-beta.311 127 6/18/2025
9.5.1-beta.310 130 6/17/2025
9.5.1-beta.309 128 6/17/2025
9.5.1-beta.308 129 6/17/2025
9.5.1-beta.307 132 6/16/2025
9.5.1-beta.306 271 6/11/2025
9.5.1-beta.305 102 6/7/2025
9.5.1-beta.304 137 6/6/2025
9.5.1-beta.303 134 6/4/2025
9.5.1-beta.302 134 6/4/2025
9.5.1-beta.301 130 6/2/2025
9.5.1-beta.300 138 5/28/2025
9.5.0 1,051 5/27/2025
9.5.0-beta.299 131 5/27/2025
9.5.0-beta.298 137 5/26/2025
9.5.0-beta.297 112 5/24/2025
9.5.0-beta.296 82 5/24/2025
9.5.0-beta.295 77 5/24/2025
9.4.1-beta.291 132 5/19/2025
9.4.1-beta.289 144 5/16/2025
9.4.1-beta.288 196 5/16/2025
9.4.1-beta.287 212 5/16/2025
9.4.1-beta.286 212 5/16/2025
9.4.1-beta.285 219 5/14/2025
9.4.1-beta.284 241 5/13/2025
9.4.1-beta.283 214 5/12/2025
9.4.1-beta.282 159 5/7/2025
9.4.1-beta.280 128 5/2/2025
9.4.1-beta.279 157 5/2/2025
9.4.1-beta.277 517 4/23/2025
9.4.1-beta.276 147 4/23/2025
9.4.1-beta.275 145 4/23/2025
9.4.1-beta.274 159 4/23/2025
9.4.1-beta.273 153 4/23/2025
9.4.1-beta.272 167 4/23/2025
9.4.1-beta.271 138 4/23/2025
9.4.1-beta.270 160 4/20/2025
9.4.0 466 4/20/2025
9.4.0-beta.269 163 4/20/2025
9.4.0-beta.268 139 4/20/2025
9.3.1-beta.267 161 4/20/2025
9.3.1-beta.266 94 4/19/2025
9.3.1-beta.265 183 4/15/2025
9.3.1-beta.264 165 4/15/2025
9.3.1-beta.263 169 4/15/2025
9.3.1-beta.262 177 4/15/2025
9.3.1-beta.260 918 4/10/2025
9.3.1-beta.259 168 4/8/2025
9.3.1-beta.258 168 4/8/2025
9.3.1-beta.257 151 4/8/2025
9.3.1-beta.256 145 4/8/2025
9.3.1-beta.255 163 4/8/2025
9.3.1-beta.254 145 4/8/2025
9.3.1-beta.253 168 4/1/2025
9.3.1-beta.252 124 3/27/2025
9.3.1-beta.250 143 3/27/2025
9.3.1-beta.249 122 3/27/2025
9.3.1-beta.248 151 3/27/2025
9.3.1-beta.247 117 3/27/2025
9.3.1-beta.244 470 3/25/2025
9.3.1-beta.242 472 3/24/2025
9.3.1-beta.241 137 3/19/2025
9.3.0 1,071 3/19/2025
9.3.0-beta.239 131 3/19/2025
9.2.2-beta.237 135 3/19/2025
9.2.2-beta.236 266 3/14/2025
9.2.2-beta.230 171 3/13/2025
9.2.2-beta.229 137 3/13/2025
9.2.2-beta.228 151 3/11/2025
9.2.2-beta.227 177 3/11/2025
9.2.2-beta.226 150 3/11/2025
9.2.2-beta.225 154 3/11/2025
9.2.2-beta.224 165 3/11/2025
9.2.2-beta.223 172 3/10/2025
9.2.2-beta.222 152 3/10/2025
9.2.2-beta.220 153 3/9/2025
9.2.2-beta.218 144 3/9/2025
9.2.2-beta.217 192 3/7/2025
9.2.2-beta.216 196 3/7/2025
9.2.2-beta.215 215 3/7/2025
9.2.2-beta.214 221 3/5/2025
9.2.2-beta.213 191 3/5/2025
9.2.2-beta.212 181 3/5/2025
9.2.2-beta.211 186 3/4/2025
9.2.2-beta.210 194 3/4/2025
9.2.2-beta.208 98 3/3/2025
9.2.1 695 3/3/2025
9.2.1-beta.207 105 3/2/2025
9.2.1-beta.206 80 3/1/2025
9.2.1-beta.205 86 2/27/2025
9.2.1-beta.204 77 2/26/2025
9.2.1-beta.203 80 2/26/2025
9.2.0 507 2/26/2025
9.2.0-beta.202 66 2/26/2025
9.2.0-beta.201 96 2/26/2025
9.2.0-beta.199 74 2/26/2025
9.2.0-beta.198 69 2/26/2025
9.1.1-beta.197 85 2/25/2025
9.1.1-beta.196 76 2/25/2025
9.1.1-beta.195 71 2/25/2025
9.1.1-beta.194 75 2/25/2025
9.1.1-beta.193 76 2/25/2025
9.1.1-beta.192 109 2/24/2025
9.1.1-beta.191 107 2/24/2025
9.1.1-beta.190 78 2/19/2025
9.1.1-beta.189 82 2/19/2025
9.1.1-beta.188 100 2/19/2025
9.1.1-beta.187 120 2/19/2025
9.1.1-beta.183 88 2/18/2025
9.1.1-beta.182 84 2/18/2025
9.1.1-beta.181 91 2/18/2025
9.1.1-beta.180 88 2/17/2025
9.1.1-beta.178 81 2/17/2025
9.1.1-beta.177 87 2/12/2025
9.1.1-beta.176 118 2/11/2025
9.1.1-beta.175 92 2/11/2025
9.1.1-beta.173 85 2/10/2025
9.1.1-beta.169 83 2/6/2025
9.1.1-beta.168 75 2/5/2025
9.1.1-beta.166 84 2/5/2025
9.1.1-beta.165 95 2/5/2025
9.1.1-beta.164 112 2/3/2025
9.1.1-beta.162 106 2/3/2025
9.1.1-beta.155 89 1/30/2025
9.1.1-beta.154 77 1/30/2025
9.1.1-beta.153 70 1/30/2025
9.1.1-beta.152 71 1/29/2025
9.1.1-beta.150 103 1/29/2025
9.1.1-beta.148 76 1/26/2025
9.1.1-beta.147 83 1/26/2025
9.1.1-beta.146 84 1/23/2025
9.1.1-beta.145 91 1/22/2025
9.1.1-beta.144 94 1/22/2025
9.1.1-beta.142 82 1/22/2025
9.1.1-beta.140 91 1/22/2025
9.1.1-beta.139 76 1/21/2025
9.1.1-beta.138 89 1/20/2025
9.1.1-beta.137 96 1/17/2025
9.1.1-beta.136 74 1/15/2025
9.1.1-beta.135 48 1/15/2025