public IActionResult Create(Product product) { if (ModelState.IsValid) { db.Products.Add(product); db.SaveChanges(); return RedirectToAction("Index"); } return View(product); }
public IActionResult Search(string term) { //TODO: Implement search var products = new Product[] { }; return View(new SearchViewModel { SearchTerm = term, Products = products }); }