From 902d7a15fd7d1e1c7946597457ad904498ec1029 Mon Sep 17 00:00:00 2001 From: MarcEricMartel <74071476+MarcEricMartel@users.noreply.github.com> Date: Tue, 25 Oct 2022 10:17:54 -0700 Subject: [PATCH] Update SearchController.cs --- .../GrossesMitainesAPI/Controllers/SearchController.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); }