Skip to content

Commit 3e25aa8

Browse files
committed
Updates
1 parent 0d26970 commit 3e25aa8

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

aspnetcore/blazor/blazor-ef-core.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Learn how to use Entity Framework Core (EF Core) in Blazor apps.
55
monikerRange: '>= aspnetcore-3.1'
66
ms.author: riande
77
ms.custom: mvc
8-
ms.date: 01/13/2025
8+
ms.date: 01/16/2025
99
uid: blazor/blazor-ef-core
1010
---
1111
# ASP.NET Core Blazor with Entity Framework Core (EF Core)
@@ -46,7 +46,7 @@ For Microsoft Azure services, we recommend using *managed identities*. Managed i
4646

4747
## Build a Blazor movie database app tutorial
4848

49-
For a tutorial experience building an app that uses EF Core to work with a database, see <xref:blazor/tutorials/movie-database-app/index>. The tutorial shows you how to create a Blazor Web App that can display and manage movies in a movie database.
49+
For a tutorial experience building an app that uses EF Core for database operations, see <xref:blazor/tutorials/movie-database-app/index>. The tutorial shows you how to create a Blazor Web App that can display and manage movies in a movie database.
5050

5151
:::moniker-end
5252

@@ -63,9 +63,9 @@ The following recommendations are designed to provide a consistent approach to u
6363
* Consider using one context per operation. The context is designed for fast, low overhead instantiation:
6464

6565
```csharp
66-
using var context = new MyContext();
66+
using var context = new ProductsDatabaseContext();
6767

68-
return await context.MyEntities.ToListAsync();
68+
return await context.Products.ToListAsync();
6969
```
7070

7171
* Use a flag to prevent multiple concurrent operations:
@@ -88,7 +88,7 @@ The following recommendations are designed to provide a consistent approach to u
8888
}
8989
```
9090

91-
Place operations after the `Loading = true;` line in the `try` block.
91+
Place database operations after the `Loading = true;` line in the `try` block.
9292

9393
Thread safety isn't a concern, so loading logic doesn't require locking database records. The loading logic is used to disable UI controls so that users don't inadvertently select buttons or update fields while data is fetched.
9494

@@ -109,6 +109,8 @@ The recommended approach to create a new <xref:Microsoft.EntityFrameworkCore.DbC
109109

110110
:::moniker range="< aspnetcore-5.0"
111111

112+
In versions of .NET prior to 5.0, use the following `DbContextFactory`:
113+
112114
```csharp
113115
using System;
114116
using Microsoft.EntityFrameworkCore;

0 commit comments

Comments
 (0)