From 0e1f873c9f32b4326c303a1c4ac9ccc386cee254 Mon Sep 17 00:00:00 2001 From: clchieu Date: Tue, 2 Apr 2024 18:09:05 +0200 Subject: [PATCH] =?UTF-8?q?V=C3=A9rification=20production?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- API_SQLuedo/API/Program.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/API_SQLuedo/API/Program.cs b/API_SQLuedo/API/Program.cs index a12b0d1..b4a4679 100644 --- a/API_SQLuedo/API/Program.cs +++ b/API_SQLuedo/API/Program.cs @@ -41,9 +41,12 @@ builder.Services.AddDbContext(options => { if (builder.Environment.IsProduction()) { - throw new Exception("I am in production mode"); + Console.WriteLine("I am in production mode"); + } + else + { + Console.WriteLine("I am in development mode"); } - throw new Exception("I am in development mode"); }); builder.Services.AddDbContext(options => options.UseInMemoryDatabase("appDb")); builder.Services.AddIdentityApiEndpoints().AddEntityFrameworkStores();