react-version #1

Merged
memartel_loc merged 290 commits from react-version into main 2023-11-04 09:48:15 -04:00
Showing only changes of commit e40807b6a2 - Show all commits

View File

@ -44,9 +44,9 @@ public class SearchController : Controller {
List<Product> title = new(), desc = new(), cat = new();
query = query.ToLower();
foreach (Product prod in _context.Products.ToArray()) {
string sTitle = prod.Title.Replace(",", " ").ToLower(),
sCat = prod.Category.ToLower(),
sDesc = prod.Description.Replace(".", " ").Replace(",", " ").ToLower();
string sTitle = prod.Title.Replace(",", " ").ToLower() + " ",
sCat = prod.Category.ToLower() + " ",
sDesc = prod.Description.Replace(".", " ").Replace(",", " ").ToLower() + " ";
if (sTitle.StartsWith(query))
products.Add(prod);
else if (sTitle.Contains(" " + query + " "))
@ -90,9 +90,9 @@ public class SearchController : Controller {
List<Product> title = new(), desc = new(), cat = new();
query = query.ToLower();
foreach (Product prod in _searchCache) {
string sTitle = prod.Title.Replace(",", " ").ToLower(),
sCat = prod.Category.ToLower(),
sDesc = prod.Description.Replace(".", " ").Replace(",", " ").ToLower();
string sTitle = prod.Title.Replace(",", " ").ToLower() + " ",
sCat = prod.Category.ToLower() + " ",
sDesc = prod.Description.Replace(".", " ").Replace(",", " ").ToLower() + " ";
if (sTitle.StartsWith(query))
products.Add(prod);
else if (sTitle.Contains(" " + query + " "))