From d97bb26e43e294989b2590a7729b3c909632d119 Mon Sep 17 00:00:00 2001 From: Augustin AFFOGNON Date: Mon, 24 Oct 2022 02:10:30 +0200 Subject: [PATCH] =?UTF-8?q?Mise=20=C3=A0=20jour=20de=20'Sources/BowlingMap?= =?UTF-8?q?ing/JoueurDbDataManager.cs'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sources/BowlingMaping/JoueurDbDataManager.cs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Sources/BowlingMaping/JoueurDbDataManager.cs b/Sources/BowlingMaping/JoueurDbDataManager.cs index ea505a4..a646e2d 100644 --- a/Sources/BowlingMaping/JoueurDbDataManager.cs +++ b/Sources/BowlingMaping/JoueurDbDataManager.cs @@ -43,7 +43,7 @@ namespace BowlingMaping bool result = false; - try{ + using (var context = new BowlingContext()) { JoueurEntity entity = context.Joueurs.Find(_joueur.Id); @@ -51,11 +51,7 @@ namespace BowlingMaping result = context.SaveChanges() == 1; } return result; - - }catch (SqlException) - { - WriteLine("Votre base de données n'existe pas."); - } + }