From 9707d2ce2373419957a88f7bb84c203fe8ebfd9f Mon Sep 17 00:00:00 2001 From: David D'ALMEIDA Date: Mon, 27 Mar 2023 17:12:22 +0200 Subject: [PATCH] =?UTF-8?q?Mise=20=C3=A0=20jour=20de=20'EntityFramework=5F?= =?UTF-8?q?LoL/Sources/ApiMappeur/ChampionMapper.cs'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/ApiMappeur/ChampionMapper.cs | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/EntityFramework_LoL/Sources/ApiMappeur/ChampionMapper.cs b/EntityFramework_LoL/Sources/ApiMappeur/ChampionMapper.cs index a5ff45a..af8d76e 100644 --- a/EntityFramework_LoL/Sources/ApiMappeur/ChampionMapper.cs +++ b/EntityFramework_LoL/Sources/ApiMappeur/ChampionMapper.cs @@ -9,13 +9,7 @@ namespace ApiMappeur public static ChampionDTO ToDTO(this Champion item) { - /*if (item == null) - { - var message = string.Format("Champion cannot be empty"); - *//*throw new HttpResponseException(Request.CreateErrorResponse(HttpStatusCode.NotFound, message)); - *//* - throw new Exception(message); - }*/ + return new ChampionDTO() { Icon = item.Icon, @@ -40,9 +34,8 @@ namespace ApiMappeur { if (item == null) { - var message = string.Format("Champion with name = {} not found", item.Name); - /*throw new HttpResponseException(Request.CreateErrorResponse(HttpStatusCode.NotFound, message)); - */ + var message = string.Format("Champion is null cannot null it "; + throw new Exception(message); } @@ -66,8 +59,6 @@ namespace ApiMappeur if (dto == null) { var message = string.Format("Champion cannot be empty"); - /*throw new HttpResponseException(Request.CreateErrorResponse(HttpStatusCode.NotFound, message)); - */ throw new Exception(message); }