From ed4c5819db75c71b319dc6d2d3d9ef3dd3bf2eab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Chalet?= Date: Tue, 25 Mar 2025 00:50:08 +0100 Subject: [PATCH] Update the ASP.NET 4.8 samples to register the ApplicationDbContext type --- sandbox/OpenIddict.Sandbox.AspNet.Client/Startup.cs | 3 +++ sandbox/OpenIddict.Sandbox.AspNet.Server/Startup.cs | 3 +++ 2 files changed, 6 insertions(+) diff --git a/sandbox/OpenIddict.Sandbox.AspNet.Client/Startup.cs b/sandbox/OpenIddict.Sandbox.AspNet.Client/Startup.cs index 67fd740f..8cd8315c 100644 --- a/sandbox/OpenIddict.Sandbox.AspNet.Client/Startup.cs +++ b/sandbox/OpenIddict.Sandbox.AspNet.Client/Startup.cs @@ -104,6 +104,9 @@ public class Startup var builder = new ContainerBuilder(); builder.Populate(services); + // Register the Entity Framework context. + builder.RegisterType().AsSelf().InstancePerLifetimeScope(); + // Register the MVC controllers. builder.RegisterControllers(typeof(Startup).Assembly); diff --git a/sandbox/OpenIddict.Sandbox.AspNet.Server/Startup.cs b/sandbox/OpenIddict.Sandbox.AspNet.Server/Startup.cs index c1b2ea00..051a1d21 100644 --- a/sandbox/OpenIddict.Sandbox.AspNet.Server/Startup.cs +++ b/sandbox/OpenIddict.Sandbox.AspNet.Server/Startup.cs @@ -125,6 +125,9 @@ public class Startup var builder = new ContainerBuilder(); builder.Populate(services); + // Register the Entity Framework context. + builder.RegisterType().AsSelf().InstancePerLifetimeScope(); + // Register the MVC controllers. builder.RegisterControllers(typeof(Startup).Assembly);