From 6747f231fe75a1cb70b0b45acc297c5029d88b0f Mon Sep 17 00:00:00 2001 From: jboinembalome Date: Thu, 4 Feb 2021 08:57:27 +0100 Subject: [PATCH] =?UTF-8?q?Nettoyage=20du=20code=20+=20D=C3=A9commenter=20?= =?UTF-8?q?l'attribut=20Authorize?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- EPAServeur/Controllers/FormationsApi.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/EPAServeur/Controllers/FormationsApi.cs b/EPAServeur/Controllers/FormationsApi.cs index 52e9203..b641701 100644 --- a/EPAServeur/Controllers/FormationsApi.cs +++ b/EPAServeur/Controllers/FormationsApi.cs @@ -216,7 +216,7 @@ namespace IO.Swagger.Controllers /// Une erreur est survenue sur le serveur [HttpGet] [Route("/api/formations/{idFormation}")] - [Authorize(AuthenticationSchemes = BearerAuthenticationHandler.SchemeName)] + //[Authorize(AuthenticationSchemes = BearerAuthenticationHandler.SchemeName)] [ValidateModelState] [SwaggerOperation("GetFormationById")] [SwaggerResponse(statusCode: 200, type: typeof(FormationDTO), description: "OK")] @@ -229,7 +229,7 @@ namespace IO.Swagger.Controllers if (env.IsDevelopment()) logger.LogInformation("Récupération de la formation {idFormation}.", idFormation); - FormationDTO formationDTO = null; + FormationDTO formationDTO; try { @@ -298,7 +298,7 @@ namespace IO.Swagger.Controllers if (env.IsDevelopment()) logger.LogInformation("Récupération de la liste des formations."); - IEnumerable formations = null; + IEnumerable formations; try { @@ -342,7 +342,7 @@ namespace IO.Swagger.Controllers /// Une erreur est survenue sur le serveur [HttpGet] [Route("/api/formations/count")] - //[Authorize(AuthenticationSchemes = BearerAuthenticationHandler.SchemeName)] + [Authorize(AuthenticationSchemes = BearerAuthenticationHandler.SchemeName)] [ValidateModelState] [SwaggerOperation("GetFormationsCount")] [SwaggerResponse(statusCode: 200, type: typeof(long?), description: "OK")] @@ -354,7 +354,7 @@ namespace IO.Swagger.Controllers if (env.IsDevelopment()) logger.LogInformation("Récupération du nombre total de formations."); - long count = 0; + long count; try { @@ -402,7 +402,7 @@ namespace IO.Swagger.Controllers if (env.IsDevelopment()) logger.LogInformation("Récupération de la liste des modes de formation."); - IEnumerable modeFormations = null; + IEnumerable modeFormations; try { @@ -449,7 +449,7 @@ namespace IO.Swagger.Controllers if (env.IsDevelopment()) logger.LogInformation("Récupération de la liste des origines de formation."); - IEnumerable origineFormations = null; + IEnumerable origineFormations; try { @@ -496,7 +496,7 @@ namespace IO.Swagger.Controllers if (env.IsDevelopment()) logger.LogInformation("Récupération de la liste des statuts de formation."); - IEnumerable statutFormations = null; + IEnumerable statutFormations; try { @@ -543,7 +543,7 @@ namespace IO.Swagger.Controllers if (env.IsDevelopment()) logger.LogInformation("Récupération de la liste des types de formation."); - IEnumerable typeFormations = null; + IEnumerable typeFormations; try {