diff --git a/GrossesMitaines/GrossesMitainesAPI/Controllers/SearchController.cs b/GrossesMitaines/GrossesMitainesAPI/Controllers/SearchController.cs index 4043923..9d60e2f 100644 --- a/GrossesMitaines/GrossesMitainesAPI/Controllers/SearchController.cs +++ b/GrossesMitaines/GrossesMitainesAPI/Controllers/SearchController.cs @@ -107,10 +107,10 @@ public class SearchController : Controller { products.AddRange(cat); } else { products = _searchCache.Where(x => x.Title.Contains(query)).ToList(); - foreach (Product prod in _searchCache.Where(x => x.Description.Contains(query)).ToList()) + foreach (Product prod in _searchCache.Where(x => x.Description.Contains(query)).ToArray()) if (!products.Contains(prod)) products.Add(prod); - foreach (Product prod in _searchCache.Where(x => x.Category.Contains(query)).ToList()) + foreach (Product prod in _searchCache.Where(x => x.Category.Contains(query)).ToArray()) if (!products.Contains(prod)) products.Add(prod); }