ajout getSomeQuote

QuoteServiceLocal
Louis GUICHARD-MONTGUERS 5 months ago
parent fe7300bd56
commit b337cc3950

@ -189,9 +189,14 @@ namespace WF_WebAdmin.Service
return null; return null;
} }
public Task<List<Quote>> getSomeQuote(int nb, int page) public async Task<List<Quote>> 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<List<Quote>> getSomeQuoteInvalid(int nb, int page) public Task<List<Quote>> getSomeQuoteInvalid(int nb, int page)

Loading…
Cancel
Save