diff --git a/Sources/ApiDePaul/Controllers/ChampionController.cs b/Sources/ApiDePaul/Controllers/ChampionController.cs index b5b661e..5e1320c 100644 --- a/Sources/ApiDePaul/Controllers/ChampionController.cs +++ b/Sources/ApiDePaul/Controllers/ChampionController.cs @@ -35,21 +35,28 @@ namespace ApiDePaul.Controllers { StubData stu = new StubData(); - + IEnumerable lcha = await stu.ChampionsMgr.GetItems(id, 1); - + if (id >= 0 && id < stu.ChampionsMgr.GetNbItems().Result) { return Ok(lcha.First().ChampToDto()); } return BadRequest(); } - /* - // GET: ChampionController/Details/5 - public ActionResult Details(int id) + + [HttpPost("{nom}")] + public async Task Post(String nom) { - return View(); + StubData stu = new StubData(); + + Champion ca = new Champion(nom); + + stu.ChampionsMgr.AddItem(ca); + + return Ok(); } + /* // GET: ChampionController/Create public ActionResult Create()