From 3c1e707bd032dcd8e0f5adea334c8398f7f36294 Mon Sep 17 00:00:00 2001 From: etudiant Date: Sun, 12 Feb 2023 08:59:26 +0100 Subject: [PATCH] delete --- .../Controllers/PartieController.cs | 32 ++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/Sources/BowlingApi/Controllers/PartieController.cs b/Sources/BowlingApi/Controllers/PartieController.cs index 5186743..60684e7 100644 --- a/Sources/BowlingApi/Controllers/PartieController.cs +++ b/Sources/BowlingApi/Controllers/PartieController.cs @@ -166,7 +166,37 @@ namespace BowlingApi.Controllers return StatusCode(StatusCodes.Status500InternalServerError, e.Message); throw; } - } + }/// + /// Supprimer une partie par son id + /// DELETE: api/parti/5 + /// + /// + /// Retourne la partie supprimé + /// Si la partie n'existe pas + /// Si une erreur est survenue + [HttpDelete("{id}")] + [ProducesResponseType(typeof(string), StatusCodes.Status500InternalServerError)] + [ProducesResponseType(typeof(string), StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(bool), StatusCodes.Status200OK)] + // [MapToApiVersion("2")] + //public async Task> Delete(long id) + //{ + // try + // { + // var parti = _partieService.Delete(id); + // if (parti.Result == false) + // { + // return NotFound(); + // } + // return Ok(parti); + // } + // catch (Exception e) + // { + // StatusCode(StatusCodes.Status500InternalServerError, e.Message); + // throw; + // } + // } + /// /// Modification partie