A long vacation
This commit is contained in:
@@ -31,8 +31,12 @@ public class SearchController : Controller {
|
||||
if (preview.HasValue && preview == true)
|
||||
products = _context.Products.Where(x => x.Title.Contains(query)).Take(PREVIEW).ToList();
|
||||
else {
|
||||
products = _context.Products.Where(x => x.Title.Contains(query)).ToList();
|
||||
|
||||
products = _context.Products.Where(x => x.Title.Replace(".", " ")
|
||||
.Replace(",", " ")
|
||||
.ToUpper()
|
||||
.Contains(" " + query.ToUpper() + " "))
|
||||
.ToList();
|
||||
|
||||
foreach (Product prod in _context.Products.Where(x => x.Category.Contains(query)).ToList()) {
|
||||
if (!products.Contains(prod))
|
||||
products.Add(prod);
|
||||
|
Reference in New Issue
Block a user