From b337cc39504482f2beca2146440f2072a86c0d39 Mon Sep 17 00:00:00 2001 From: Louis GUICHARD-MONTGUERS Date: Tue, 21 Jan 2025 15:14:50 +0100 Subject: [PATCH] ajout getSomeQuote --- WF-WebAdmin/WF-WebAdmin/Service/QuoteServiceLocal.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/WF-WebAdmin/WF-WebAdmin/Service/QuoteServiceLocal.cs b/WF-WebAdmin/WF-WebAdmin/Service/QuoteServiceLocal.cs index f20136f..493167e 100644 --- a/WF-WebAdmin/WF-WebAdmin/Service/QuoteServiceLocal.cs +++ b/WF-WebAdmin/WF-WebAdmin/Service/QuoteServiceLocal.cs @@ -189,9 +189,14 @@ namespace WF_WebAdmin.Service return null; } - public Task> getSomeQuote(int nb, int page) + public async Task> getSomeQuote(int nb, int page) { - throw new NotImplementedException(); + var quotes = await getAllQuote(); + if ((page - 1) * nb + nb > quotes.Count()) + { + return quotes.GetRange(quotes.Count() - nb, nb); + } + return quotes.GetRange((page - 1) * nb, nb); } public Task> getSomeQuoteInvalid(int nb, int page)