Skip to content

Commit 37da523

Browse files
authored
IDbContextFactory in 3.x sample app (#20025)
1 parent f70fb78 commit 37da523

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

aspnetcore/blazor/blazor-server-ef-core.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,10 @@ The recommended solution to create a new <xref:Microsoft.EntityFrameworkCore.DbC
186186

187187
[!code-csharp[](./common/samples/3.x/BlazorServerEFCoreSample/BlazorServerDbContextExample/Data/DbContextFactory.cs)]
188188

189-
In the preceding factory, <xref:Microsoft.Extensions.DependencyInjection.ActivatorUtilities.CreateInstance%2A?displayProperty=nameWithType> satisfies any dependencies via the service provider.
189+
In the preceding factory:
190+
191+
* <xref:Microsoft.Extensions.DependencyInjection.ActivatorUtilities.CreateInstance%2A?displayProperty=nameWithType> satisfies any dependencies via the service provider.
192+
* `IDbContextFactory` is available in EF Core ASP.NET Core 5.0 or later, so the interface is [implemented in the sample app for ASP.NET Core 3.x](https://github.com/dotnet/AspNetCore.Docs/blob/master/aspnetcore/blazor/common/samples/3.x/BlazorServerEFCoreSample/BlazorServerDbContextExample/Data/IDbContextFactory.cs).
190193

191194
The following example configures [SQLite](https://www.sqlite.org/index.html) and enables data logging. The code uses an extension method to configure the database factory for DI and provide default options:
192195

0 commit comments

Comments
 (0)