diff --git a/Sources/API_LoL/Controllers/ChampionsController.cs b/Sources/API_LoL/Controllers/ChampionsController.cs index 86f7a94..b397831 100644 --- a/Sources/API_LoL/Controllers/ChampionsController.cs +++ b/Sources/API_LoL/Controllers/ChampionsController.cs @@ -30,6 +30,12 @@ namespace API_LoL.Controllers // GET api//5 + [HttpGet("count")] + public async Task GetCount() + { + return Ok(ChampionsManager.GetNbItems()); + } + [HttpGet] public async Task Get(string? name = null,String? skill = null, String? characteristic = null,int index = 0,int size =10) { diff --git a/Sources/EntityFramework/Manager/EFDataManager.Champions.cs b/Sources/EntityFramework/Manager/EFDataManager.Champions.cs index cef096a..689959b 100644 --- a/Sources/EntityFramework/Manager/EFDataManager.Champions.cs +++ b/Sources/EntityFramework/Manager/EFDataManager.Champions.cs @@ -129,9 +129,12 @@ namespace EntityFramework.Manager } } - public Task GetNbItems() + public async Task GetNbItems() { - throw new NotImplementedException(); + using(var context = new LoLDBContextWithStub()) + { + return context.Champions.Count(); + } } public Task GetNbItemsByCharacteristic(string charName)