Skip to content

Commit c3eeafd

Browse files
committed
work
1 parent 6293363 commit c3eeafd

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

entity-framework/core/dbcontext-configuration/index.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@ ASP.NET Core applications are [configured using dependency injection](/aspnet/co
5151

5252
[!code-csharp[ConfigureServices](../../../samples/core/Miscellaneous/ConfiguringDbContext/WebApp/Startup.cs?name=ConfigureServices)]
5353

54-
[!code-csharp[ConfigureServices](~/Miscellaneous/ConfiguringDbContext/WebApp9/Program.cs?name=snippet_1)]
54+
[!code-csharp[snippet_1](../../../samples/core/Miscellaneous/ConfiguringDbContext/WebApp9/Program.cs?name=ConfigureSersnippet_1vices)]
55+
56+
C:\GH\EntityFramework.Docs\samples\core\Miscellaneous\ConfiguringDbContext\WebApp9\Program.cs
57+
[!code-csharp[ConfigureServices](~/core/Miscellaneous/ConfiguringDbContext/WebApp9/Program.cs?name=snippet_1)]
5558

5659
The preceding code registers `ApplicationDbContext`, a subclass of `DbContext` as a scoped service in the ASP.NET Core app service provider. The service provider is also know as the dependency injection container. The context is configured to use the SQL Server database provider and reads the connection string from ASP.NET Core configuration.
5760

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1-
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
2-
using Microsoft.EntityFrameworkCore;
1+
using Microsoft.EntityFrameworkCore;
32

4-
namespace WebApp9.Data
3+
public class ApplicationDbContext : DbContext
54
{
6-
public class ApplicationDbContext : IdentityDbContext
5+
public ApplicationDbContext(
6+
DbContextOptions<ApplicationDbContext> options)
7+
: base(options)
78
{
8-
public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options)
9-
: base(options)
10-
{
11-
}
129
}
1310
}

0 commit comments

Comments
 (0)