Skip to content

Commit ed4c581

Browse files
committed
Update the ASP.NET 4.8 samples to register the ApplicationDbContext type
1 parent 22ebaa0 commit ed4c581

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

sandbox/OpenIddict.Sandbox.AspNet.Client/Startup.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ public void Configuration(IAppBuilder app)
104104
var builder = new ContainerBuilder();
105105
builder.Populate(services);
106106

107+
// Register the Entity Framework context.
108+
builder.RegisterType<ApplicationDbContext>().AsSelf().InstancePerLifetimeScope();
109+
107110
// Register the MVC controllers.
108111
builder.RegisterControllers(typeof(Startup).Assembly);
109112

sandbox/OpenIddict.Sandbox.AspNet.Server/Startup.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,9 @@ public void Configuration(IAppBuilder app)
125125
var builder = new ContainerBuilder();
126126
builder.Populate(services);
127127

128+
// Register the Entity Framework context.
129+
builder.RegisterType<ApplicationDbContext>().AsSelf().InstancePerLifetimeScope();
130+
128131
// Register the MVC controllers.
129132
builder.RegisterControllers(typeof(Startup).Assembly);
130133

0 commit comments

Comments
 (0)